From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 00:06:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB900106564A; Sun, 24 Apr 2011 00:06:56 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B31038FC08; Sun, 24 Apr 2011 00:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3O06ugx009041; Sun, 24 Apr 2011 00:06:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3O06uBT009037; Sun, 24 Apr 2011 00:06:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104240006.p3O06uBT009037@svn.freebsd.org> From: Rick Macklem Date: Sun, 24 Apr 2011 00:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220980 - in head: . usr.sbin/mountd usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 00:06:56 -0000 Author: rmacklem Date: Sun Apr 24 00:06:56 2011 New Revision: 220980 URL: http://svn.freebsd.org/changeset/base/220980 Log: This patch changes the default NFS server to the new one, which was referred to as the experimental server. It also adds a new command line option "-o" to both mountd and nfsd that forces them to use the old/regular NFS server. The "-e" option for these commands is now a no-op, since the new server is the default. I will be committing rc script and man changes soon. Discussed on freebsd-fs@. Modified: head/UPDATING head/usr.sbin/mountd/mountd.c head/usr.sbin/nfsd/nfsd.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Apr 23 23:11:44 2011 (r220979) +++ head/UPDATING Sun Apr 24 00:06:56 2011 (r220980) @@ -22,6 +22,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110423: + The default NFS server has been changed to the new server, which + was referred to as the experimental server. If you need to switch + back to the old NFS server, you must now put the "-o" option on + both the mountd and nfsd commands. This can be done using the + mountd_flags and nfs_server_flags rc.conf variables until an + update to the rc scripts is committed, which is coming soon. + 20110418: The GNU Objective-C runtime library (libobjc), and other Objective-C related components have been removed from the base system. If you Modified: head/usr.sbin/mountd/mountd.c ============================================================================== --- head/usr.sbin/mountd/mountd.c Sat Apr 23 23:11:44 2011 (r220979) +++ head/usr.sbin/mountd/mountd.c Sun Apr 24 00:06:56 2011 (r220980) @@ -239,7 +239,7 @@ static int have_v6 = 1; int v4root_phase = 0; char v4root_dirpath[PATH_MAX + 1]; -int run_v4server = 0; +int run_v4server = 1; int has_publicfh = 0; struct pidfh *pfh = NULL; @@ -296,13 +296,13 @@ main(int argc, char **argv) else close(s); - while ((c = getopt(argc, argv, "2deh:lnp:r")) != -1) + while ((c = getopt(argc, argv, "2deh:lnop:r")) != -1) switch (c) { case '2': force_v2 = 1; break; case 'e': - run_v4server = 1; + /* now a no-op, since this is the default */ break; case 'n': resvport_only = 0; @@ -316,6 +316,9 @@ main(int argc, char **argv) case 'l': dolog = 1; break; + case 'o': + run_v4server = 0; + break; case 'p': endptr = NULL; svcport = (in_port_t)strtoul(optarg, &endptr, 10); @@ -350,9 +353,8 @@ main(int argc, char **argv) }; /* - * If the "-e" option was specified OR only the nfsd module is - * found in the server, run "nfsd". - * Otherwise, try and run "nfsserver". + * Unless the "-o" option was specified, try and run "nfsd". + * If "-o" was specified, try and run "nfsserver". */ if (run_v4server > 0) { if (modfind("nfsd") < 0) { @@ -360,8 +362,6 @@ main(int argc, char **argv) if (kldload("nfsd") < 0 || modfind("nfsd") < 0) errx(1, "NFS server is not available"); } - } else if (modfind("nfsserver") < 0 && modfind("nfsd") >= 0) { - run_v4server = 1; } else if (modfind("nfsserver") < 0) { /* Not present in kernel, try loading it */ if (kldload("nfsserver") < 0 || modfind("nfsserver") < 0) Modified: head/usr.sbin/nfsd/nfsd.c ============================================================================== --- head/usr.sbin/nfsd/nfsd.c Sat Apr 23 23:11:44 2011 (r220979) +++ head/usr.sbin/nfsd/nfsd.c Sun Apr 24 00:06:56 2011 (r220980) @@ -88,7 +88,7 @@ int debug = 0; pid_t children[MAXNFSDCNT]; /* PIDs of children */ int nfsdcnt; /* number of children */ int new_syscall; -int run_v4server = 0; /* Force running of nfsv4 server */ +int run_v4server = 1; /* Force running of nfsv4 server */ int nfssvc_nfsd; /* Set to correct NFSSVC_xxx flag */ int stablefd = -1; /* Fd for the stable restart file */ int backupfd; /* Fd for the backup stable restart file */ @@ -152,8 +152,8 @@ main(int argc, char **argv) nfsdcnt = DEFNFSDCNT; unregister = reregister = tcpflag = maxsock = 0; bindanyflag = udpflag = connect_type_cnt = bindhostc = 0; -#define GETOPT "ah:n:rdtue" -#define USAGE "[-ardtue] [-n num_servers] [-h bindip]" +#define GETOPT "ah:n:rdtueo" +#define USAGE "[-ardtueo] [-n num_servers] [-h bindip]" while ((ch = getopt(argc, argv, GETOPT)) != -1) switch (ch) { case 'a': @@ -189,7 +189,10 @@ main(int argc, char **argv) udpflag = 1; break; case 'e': - run_v4server = 1; + /* now a no-op, since this is the default */ + break; + case 'o': + run_v4server = 0; break; default: case '?': @@ -216,9 +219,8 @@ main(int argc, char **argv) } /* - * If the "-e" option was specified OR only the nfsd module is - * found in the server, run "nfsd". - * Otherwise, try and run "nfsserver". + * Unless the "-o" option was specified, try and run "nfsd". + * If "-o" was specified, try and run "nfsserver". */ if (run_v4server > 0) { if (modfind("nfsd") < 0) { @@ -226,8 +228,6 @@ main(int argc, char **argv) if (kldload("nfsd") < 0 || modfind("nfsd") < 0) errx(1, "NFS server is not available"); } - } else if (modfind("nfsserver") < 0 && modfind("nfsd") >= 0) { - run_v4server = 1; } else if (modfind("nfsserver") < 0) { /* Not present in kernel, try loading it */ if (kldload("nfsserver") < 0 || modfind("nfsserver") < 0) From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 01:11:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B90D106564A; Sun, 24 Apr 2011 01:11:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 791F18FC08; Sun, 24 Apr 2011 01:11:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3O1BSl3010960; Sun, 24 Apr 2011 01:11:28 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3O1BSZv010957; Sun, 24 Apr 2011 01:11:28 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104240111.p3O1BSZv010957@svn.freebsd.org> From: Rick Macklem Date: Sun, 24 Apr 2011 01:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220981 - in head/usr.sbin: mountd nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 01:11:28 -0000 Author: rmacklem Date: Sun Apr 24 01:11:28 2011 New Revision: 220981 URL: http://svn.freebsd.org/changeset/base/220981 Log: Patch the mountd and nfsd man pages to reflect the recent changes done by r220980 to deprecate the -e option and add the -o option. This is a content change for both man pages. Modified: head/usr.sbin/mountd/mountd.8 head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/mountd/mountd.8 ============================================================================== --- head/usr.sbin/mountd/mountd.8 Sun Apr 24 00:06:56 2011 (r220980) +++ head/usr.sbin/mountd/mountd.8 Sun Apr 24 01:11:28 2011 (r220981) @@ -28,7 +28,7 @@ .\" @(#)mountd.8 8.4 (Berkeley) 4/28/95 .\" $FreeBSD$ .\" -.Dd October 20, 2007 +.Dd April 23, 2011 .Dt MOUNTD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ mount requests .Sh SYNOPSIS .Nm -.Op Fl 2delnr +.Op Fl 2delnor .Op Fl h Ar bindip .Op Fl p Ar port .Op Ar exportsfile ... @@ -69,17 +69,8 @@ Output debugging information. will not detach from the controlling terminal and will print debugging messages to stderr. .It Fl e -Forces -.Nm -to try and start the experimental server that includes NFSv4 support in it. -If this flag isn't specified, the experimental server will only be started -if it is linked into the kernel and the regular one isn't. -.br -ie. The kernel is built with the following: -.Bd -literal -offset indent -compact -# options NFSSERVER -options NFSD -.Ed +The new NFS server that includes NFSv4 support is now the default, so this +option is now a no-op and should be considered deprecated. .It Fl h Ar bindip Specify specific IP addresses to bind to for TCP and UDP requests. This option may be specified multiple times. @@ -107,6 +98,9 @@ This should only be specified if there a that require it. It will automatically clear the vfs.nfsrv.nfs_privport sysctl flag, which controls if the kernel will accept NFS requests from reserved ports only. +.It Fl o +This flag forces the system to run the old NFS server, which does not +have NFSv4 support in it. .It Fl p Ar port Force .Nm Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Sun Apr 24 00:06:56 2011 (r220980) +++ head/usr.sbin/nfsd/nfsd.8 Sun Apr 24 01:11:28 2011 (r220981) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd April 19, 2011 +.Dd April 23, 2011 .Dt NFSD 8 .Os .Sh NAME @@ -38,7 +38,7 @@ server .Sh SYNOPSIS .Nm -.Op Fl ardute +.Op Fl arduteo .Op Fl n Ar num_servers .Op Fl h Ar bindip .Sh DESCRIPTION @@ -101,17 +101,11 @@ Serve .Tn UDP NFS clients. .It Fl e -Forces -.Nm -to try and start the experimental server that includes NFSv4 support in it. -If this flag isn't specified, the experimental server will only be started -if it is linked into the kernel and the regular one isn't. -.br -ie. The kernel is built with the following: -.Bd -literal -offset indent -compact -# options NFSSERVER -options NFSD -.Ed +The new NFS server that includes NFSv4 support is now the default, so this +option is now a no-op and should be considered deprecated. +.It Fl o +Forces the use of the old NFS server that does not include NFSv4 support +in it. .El .Pp For example, From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 01:44:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A50106566C; Sun, 24 Apr 2011 01:44:22 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 272EE8FC16; Sun, 24 Apr 2011 01:44:21 +0000 (UTC) Received: by wyf23 with SMTP id 23so1366542wyf.13 for ; Sat, 23 Apr 2011 18:44:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.62.74 with SMTP id x52mr1544178wec.45.1303609460458; Sat, 23 Apr 2011 18:44:20 -0700 (PDT) Sender: andy@fud.org.nz Received: by 10.216.181.144 with HTTP; Sat, 23 Apr 2011 18:44:20 -0700 (PDT) In-Reply-To: <201104240006.p3O06uBT009037@svn.freebsd.org> References: <201104240006.p3O06uBT009037@svn.freebsd.org> Date: Sun, 24 Apr 2011 13:44:20 +1200 X-Google-Sender-Auth: p0BE1UJDtEvFoJFYrpEl0T9KhwU Message-ID: From: Andrew Thompson To: Rick Macklem Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220980 - in head: . usr.sbin/mountd usr.sbin/nfsd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 01:44:22 -0000 On 24 April 2011 12:06, Rick Macklem wrote: > Author: rmacklem > Date: Sun Apr 24 00:06:56 2011 > New Revision: 220980 > URL: http://svn.freebsd.org/changeset/base/220980 > > Log: > =A0This patch changes the default NFS server to the new one, which was > =A0referred to as the experimental server. It also adds a new command > =A0line option "-o" to both mountd and nfsd that forces them to use the > =A0old/regular NFS server. The "-e" option for these commands is now > =A0a no-op, since the new server is the default. I will be committing rc > =A0script and man changes soon. Discussed on freebsd-fs@. Congratulations. From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 08:58:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5341106564A; Sun, 24 Apr 2011 08:58:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFF1B8FC08; Sun, 24 Apr 2011 08:58:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3O8wwuG024655; Sun, 24 Apr 2011 08:58:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3O8wwqT024628; Sun, 24 Apr 2011 08:58:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201104240858.p3O8wwqT024628@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Apr 2011 08:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 08:58:58 -0000 Author: mav Date: Sun Apr 24 08:58:58 2011 New Revision: 220982 URL: http://svn.freebsd.org/changeset/base/220982 Log: Switch the GENERIC kernels for all architectures to the new CAM-based ATA stack. It means that all legacy ATA drivers are disabled and replaced by respective CAM drivers. If you are using ATA device names in /etc/fstab or other places, make sure to update them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential numbers for each type in order of detection, unless configured otherwise with tunables, see cam(4)). ataraid(4) functionality is now supported by the RAID GEOM class. To use it you can load geom_raid kernel module and use graid(8) tool for management. Instead of /dev/arX device names, use /dev/raid/rX. Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/arm/conf/AVILA head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/EP80219 head/sys/arm/conf/IQ31244 head/sys/arm/conf/TS7800 head/sys/conf/NOTES head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX head/sys/ia64/conf/GENERIC head/sys/mips/conf/MALTA head/sys/mips/conf/MALTA64 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/std.SWARM head/sys/mips/malta/std.malta head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/sparc64/conf/GENERIC head/sys/sun4v/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Apr 24 01:11:28 2011 (r220981) +++ head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) @@ -22,6 +22,34 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20110424: + The GENERIC kernels for all architectures now default to the new + CAM-based ATA stack. It means that all legacy ATA drivers were + removed and replaced by respective CAM drivers. If you are using + ATA device names in /etc/fstab or other places, make sure to update + them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, + where 'Y's are the sequential numbers for each type in order of + detection, unless configured otherwise with tunables, see cam(4)). + + ataraid(4) functionality is now supported by the RAID GEOM class. + To use it you can load geom_raid kernel module and use graid(8) tool + for management. Instead of /dev/arX device names, use /dev/raid/rX. + + No kernel config options or code have been removed, so if a problem + arises, please report it and optionally revert to the old ATA stack. + In order to do it you can remove from the kernel config: + options ATA_CAM + device ahci + device mvs + device siis + , and instead add back: + device atadisk # ATA disk drives + device ataraid # ATA RAID drives + device atapicd # ATAPI CDROM drives + device atapifd # ATAPI floppy drives + device atapist # ATAPI tape drives + options ATA_STATIC_ID # Static device numbering + 20110423: The default NFS server has been changed to the new server, which was referred to as the experimental server. If you need to switch Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/amd64/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -89,14 +89,12 @@ device pci # Floppy drives device fdc -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices @@ -120,13 +118,13 @@ device adw # Advansys wide SCSI adapte device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. device bt # Buslogic/Mylex MultiMaster SCSI adapters -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/AVILA Sun Apr 24 08:58:58 2011 (r220982) @@ -92,8 +92,8 @@ device gpioled device avila_gpio # GPIO pins on J8 device ata -device atadisk # ATA disk drives device avila_ata # Gateworks CF/IDE support +options ATA_CAM device npe # Network Processing Engine device npe_fw @@ -149,8 +149,9 @@ device usb device ohci device ehci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) #device ural #device zyd Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/CAMBRIA Sun Apr 24 08:58:58 2011 (r220982) @@ -95,8 +95,8 @@ device gpioled device cambria_gpio # GPIO pins on J11 device ata -device atadisk # ATA disk drives device avila_ata # Gateworks CF/IDE support +options ATA_CAM device npe # Network Processing Engine device npe_fw @@ -154,8 +154,9 @@ options USB_EHCI_BIG_ENDIAN_DESC # hand #options USB_DEBUG device ehci device umass -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) #device ural #device zyd Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/CRB Sun Apr 24 08:58:58 2011 (r220982) @@ -73,12 +73,12 @@ device uart device pci device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +options ATA_CAM + +device scbus # SCSI bus (required for ATA/SCSI) +device cd # CD +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) device "7seg" Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/DB-78XXX Sun Apr 24 08:58:58 2011 (r220982) @@ -81,8 +81,7 @@ device iicbus device ds133x # SATA -device ata -device atadisk +device mvs # Flattened Device Tree options FDT Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/DB-88F5XXX Sun Apr 24 08:58:58 2011 (r220982) @@ -83,8 +83,7 @@ device pass device da # SATA -device ata -device atadisk +device mvs # Flattened Device Tree options FDT Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/DB-88F6XXX Sun Apr 24 08:58:58 2011 (r220982) @@ -80,8 +80,7 @@ device iic device iicbus # SATA -device ata -device atadisk +device mvs # Flattened Device Tree options FDT Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/EP80219 Sun Apr 24 08:58:58 2011 (r220982) @@ -73,12 +73,12 @@ device uart device pci device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +options ATA_CAM + +device scbus # SCSI bus (required for ATA/SCSI) +device cd # CD +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) # SCSI Controllers @@ -111,4 +111,4 @@ options INCLUDE_CONFIG_FILE # Inclu options VERBOSE_INIT_ARM device bpf -#options ROOTDEVNAME=\"ufs:ad4s1a\" +#options ROOTDEVNAME=\"ufs:ada0s1a\" Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/IQ31244 Sun Apr 24 08:58:58 2011 (r220982) @@ -72,12 +72,12 @@ device uart device pci device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +options ATA_CAM + +device scbus # SCSI bus (required for ATA/SCSI) +device cd # CD +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) # SCSI Controllers Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/arm/conf/TS7800 Sun Apr 24 08:58:58 2011 (r220982) @@ -71,7 +71,7 @@ device da # SATA device ata -device atadisk +options ATA_CAM # Flattened Device Tree options FDT Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/conf/NOTES Sun Apr 24 08:58:58 2011 (r220982) @@ -1754,9 +1754,9 @@ hint.ata.1.irq="15" # atapifd, atapist, atapicam) and all user-level APIs. # cam(4) drivers and APIs will be connected instead. -options ATA_STATIC_ID +#options ATA_STATIC_ID #options ATA_REQUEST_TIMEOUT=10 -#options ATA_CAM +options ATA_CAM # # Standard floppy disk controllers and floppy tapes, supports Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/i386/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -91,14 +91,12 @@ device pci # Floppy drives device fdc -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahb # EISA AHA1742 family @@ -127,13 +125,13 @@ device ncv # NCR 53C500 device nsp # Workbit Ninja SCSI-3 device stg # TMC 18C30/18C50 -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/i386/conf/XBOX Sun Apr 24 08:58:58 2011 (r220982) @@ -16,7 +16,7 @@ device sc # syscons device fb # no support yet for root device name fetching -options ROOTDEVNAME=\"ufs:ad0s1a\" +options ROOTDEVNAME=\"ufs:ada0s1a\" #options ROOTDEVNAME=\"cd9660:acd0\" options SCHED_4BSD # 4BSD scheduler @@ -51,13 +51,13 @@ device pci # ATA and ATAPI devices device ata -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -options ATA_STATIC_ID # Static device numbering +options ATA_CAM -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device cd # CD device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) # Pseudo devices. device loop # Network loopback Modified: head/sys/ia64/conf/GENERIC ============================================================================== --- head/sys/ia64/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/ia64/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -73,16 +73,15 @@ options MALLOC_DEBUG_MAXZONES=8 # Separ device firewire # FireWire bus code device miibus # MII bus support (Ethernet) device pci # PCI bus support -device scbus # SCSI bus (required for SCSI) +device scbus # SCSI bus (required for ATA/SCSI) device usb # USB Bus (required for USB) -# ATA and ATAPI devices -device ata # ATA controller -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -device ataraid # ATA RAID drives +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and AIC7xxx devices @@ -101,11 +100,11 @@ device ips # IBM (Adaptec) ServeRAID device mly # Mylex AcceleRAID/eXtremeRAID device twa # 3ware 9000 series PATA/SATA RAID -# SCSI peripherals +# ATA/SCSI peripherals device cd # CD-ROM, DVD-ROM etc. device ch # Media changer device da # Direct Access (ie disk) -device pass # Passthrough (direct SCSI access) +device pass # Passthrough (direct ATA/SCSI access) device sa # Sequential Access (ie tape) device ses # Environmental Services (and SAF-TE) Modified: head/sys/mips/conf/MALTA ============================================================================== --- head/sys/mips/conf/MALTA Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/mips/conf/MALTA Sun Apr 24 08:58:58 2011 (r220982) @@ -53,7 +53,7 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options ROOTDEVNAME=\"ufs:ad0s1a\" +options ROOTDEVNAME=\"ufs:ada0s1a\" # Debugging for use in -current Modified: head/sys/mips/conf/MALTA64 ============================================================================== --- head/sys/mips/conf/MALTA64 Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/mips/conf/MALTA64 Sun Apr 24 08:58:58 2011 (r220982) @@ -53,7 +53,7 @@ options FFS #Berkeley Fast Filesystem options SOFTUPDATES #Enable FFS soft updates support options UFS_ACL #Support for access control lists options UFS_DIRHASH #Improve performance on big directories -options ROOTDEVNAME=\"ufs:ad0s1a\" +options ROOTDEVNAME=\"ufs:ada0s1a\" # Debugging for use in -current Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/mips/conf/OCTEON1 Sun Apr 24 08:58:58 2011 (r220982) @@ -95,14 +95,12 @@ options SMP # Symmetric MultiProcesso # Bus support. device pci -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device ataraid # ATA RAID drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # On-board Compact Flash driver. device cf @@ -129,13 +127,13 @@ device adw # Advansys wide SCSI adapte device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. device bt # Buslogic/Mylex MultiMaster SCSI adapters -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem Modified: head/sys/mips/conf/std.SWARM ============================================================================== --- head/sys/mips/conf/std.SWARM Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/mips/conf/std.SWARM Sun Apr 24 08:58:58 2011 (r220982) @@ -52,9 +52,9 @@ device ehci device umass device scbus +device cd device da +device pass device ata -device atadisk -device atapicd -options ATA_STATIC_ID +options ATA_CAM Modified: head/sys/mips/malta/std.malta ============================================================================== --- head/sys/mips/malta/std.malta Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/mips/malta/std.malta Sun Apr 24 08:58:58 2011 (r220982) @@ -5,4 +5,9 @@ cpu CPU_MIPS4KC #options ISA_MIPS32 device pci device ata -device atadisk +options ATA_CAM + +device scbus # SCSI bus (required for ATA/SCSI) +device cd # CD +device da # Direct Access (disks) +device pass # Passthrough device (direct ATA/SCSI access) Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/pc98/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -87,13 +87,12 @@ device pci # Floppy drives device fdc -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -device atapifd # ATAPI floppy drives -device atapist # ATAPI tape drives -options ATA_STATIC_ID # Static device numbering +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device adv # Advansys SCSI adapters @@ -110,13 +109,13 @@ device ncv # NCR 53C500 device nsp # Workbit Ninja SCSI-3 device stg # TMC 18C30/18C50 -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) device ses # SCSI Environmental Services (and SAF-TE) # keyboard driver Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/powerpc/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -86,12 +86,12 @@ device cpufreq device pci device agp -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -#device atapifd # ATAPI floppy drives -#device atapist # ATAPI tape drives +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices @@ -103,12 +103,12 @@ device ispfw # Firmware module for Qlo device mpt # LSI-Logic MPT-Fusion device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # syscons is the default console driver, resembling an SCO console device sc Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/powerpc/conf/GENERIC64 Sun Apr 24 08:58:58 2011 (r220982) @@ -86,12 +86,12 @@ device cpufreq device pci device agp -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -#device atapifd # ATAPI floppy drives -#device atapist # ATAPI tape drives +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices @@ -103,12 +103,12 @@ device ispfw # Firmware module for Qlo device mpt # LSI-Logic MPT-Fusion device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) # syscons is the default console driver, resembling an SCO console device sc Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/powerpc/conf/MPC85XX Sun Apr 24 08:58:58 2011 (r220982) @@ -56,7 +56,7 @@ options WITNESS options WITNESS_SKIPSPIN device ata -device atadisk +options ATA_CAM device bpf device cfi device crypto @@ -72,6 +72,7 @@ device iicbus device loop device md device miibus +device pass device pci device pty device quicc Modified: head/sys/sparc64/conf/GENERIC ============================================================================== --- head/sys/sparc64/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/sparc64/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -88,15 +88,12 @@ device fhc # Floppy drives #device fdc -# ATA and ATAPI devices -device ata -device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -#device atapifd # ATAPI floppy drives -#device atapist # ATAPI tape drives -# Do NOT enable ATA_STATIC_ID -- cmd646 controller will be !ata2!, -# and you will not mount an ATA /. -#options ATA_STATIC_ID # Static device numbering +# ATA controllers +device ahci # AHCI-compatible SATA controllers +device ata # Legacy ATA/SATA controllers +options ATA_CAM # Handle legacy controllers with CAM +device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA +device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA # SCSI Controllers device ahc # AHA2940 and onboard AIC7xxx devices @@ -109,13 +106,13 @@ device mpt # LSI-Logic MPT-Fusion device sym # NCR/Symbios/LSI Logic 53C8XX/53C1010/53C1510D device esp # NCR53c9x (FEPS/FAS366) -# SCSI peripherals -device scbus # SCSI bus (required for SCSI) +# ATA/SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI access) +device pass # Passthrough device (direct ATA/SCSI access) device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers Modified: head/sys/sun4v/conf/GENERIC ============================================================================== --- head/sys/sun4v/conf/GENERIC Sun Apr 24 01:11:28 2011 (r220981) +++ head/sys/sun4v/conf/GENERIC Sun Apr 24 08:58:58 2011 (r220982) @@ -95,13 +95,7 @@ device pci # ATA and ATAPI devices device ata -#device atadisk # ATA disk drives -device atapicd # ATAPI CDROM drives -#device atapifd # ATAPI floppy drives -#device atapist # ATAPI tape drives -# Do NOT enable ATA_STATIC_ID -- cmd646 controller will be !ata2!, -# and you will not mount an ATA /. -#options ATA_STATIC_ID # Static device numbering +options ATA_CAM # SCSI Controllers #device ahc # AHA2940 and onboard AIC7xxx devices From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 09:06:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95A05106567C; Sun, 24 Apr 2011 09:06:14 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 22DB68FC1B; Sun, 24 Apr 2011 09:06:14 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id E3332E6262; Sun, 24 Apr 2011 10:06:12 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=HEdaPNrKO3JY FIZA5f9azzjzHvU=; b=HxOYkdSRS3jK3LtY/hgH4K8t+ttiMr6y+Ye2fgOl0xcP YK160jRJs2n0DggQcUSNwwiHIpcIzQWTSKRXpJh4D/hn9skgh1+6D3otdDJn7IDm zjUOQrjzeNtQ0G53nOjTgVAdRawNJBG/sI7HOaxO9PJeMvvIsK+VapIq8J0lklE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=n6c9Rz D4GjGpWkFrdfOehv1ZCNR3OxScgGGCr63gDSIbL1U5FLH+58a0mWSDOWHq2zhFLO Hdv8V0r8hYVL+pBIjVLPvhtEJtHnyrMLeMdvM7eExoj5+RUVuT26qZwokwIbwWjM Wy+r7waBufw2R8FovvqSbZWcGMe7XsmeQLiZk= Received: from unknown (188-222-18-231.zone13.bethere.co.uk [188.222.18.231]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 947E5E6261; Sun, 24 Apr 2011 10:06:12 +0100 (BST) Date: Sun, 24 Apr 2011 10:06:11 +0100 From: Bruce Cran To: Alexander Motin Message-ID: <20110424100611.000020eb@unknown> In-Reply-To: <201104240858.p3O8wwqT024628@svn.freebsd.org> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> X-Mailer: Claws Mail 3.7.8cvs47 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 09:06:14 -0000 On Sun, 24 Apr 2011 08:58:58 +0000 (UTC) Alexander Motin wrote: > If you are using ATA > device names in /etc/fstab or other places, make sure to update them > respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, > where 'Y's are the sequential numbers for each type in order of > detection, unless configured otherwise with tunables, see cam(4)). People might expect that if ata(4) numbering starts with ad4, ada4 would be created. However on my machines I've seen ad4 get mapped to ada0. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 09:15:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821081065677; Sun, 24 Apr 2011 09:15:56 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id A2F8D8FC13; Sun, 24 Apr 2011 09:15:55 +0000 (UTC) Received: by bwz12 with SMTP id 12so1747149bwz.13 for ; Sun, 24 Apr 2011 02:15:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=XyUvRotJCTOEDIy+Yddq4NIyFiWrwhbjJ/vD4TZ1uB0=; b=MfnNv5perj0IFGsOoCWn3YBLBZjYnl3oKeg/UTKZ9GOhyTrZlR8W6Dd+kSNIUs5IAA CjAzUhwkHw/fNv2ZwBxe5ef5RfIbjGstORmBeBKGSpuZzlhvfUDSK+TTha2+3h5IsFLB Rd+sGb5o+atUScSgNFwC9Qjzs/vHhXHf2Q67s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=TAZb/T905Wo+7zSz9OPvIyp7HxUXbN+TuaTQtQVvz5b745bYKNK5eyg/UgIaDTrgkr MJTxbqhBPy76s2gyNfd04KZvDDUo/Ag/dH30HEcrabl9seKY/5Nvrwwd+Ftd4v5qbPm7 iCo8/bYUKfCUZnobecTeR8YT+o/DNTixrp8sE= Received: by 10.205.33.194 with SMTP id sp2mr2548370bkb.27.1303636554535; Sun, 24 Apr 2011 02:15:54 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id c11sm2646677bkc.2.2011.04.24.02.15.52 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 02:15:53 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB3EA47.5070304@FreeBSD.org> Date: Sun, 24 Apr 2011 12:15:51 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Bruce Cran References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <20110424100611.000020eb@unknown> In-Reply-To: <20110424100611.000020eb@unknown> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 09:15:56 -0000 On 24.04.2011 12:06, Bruce Cran wrote: > On Sun, 24 Apr 2011 08:58:58 +0000 (UTC) > Alexander Motin wrote: > >> If you are using ATA >> device names in /etc/fstab or other places, make sure to update them >> respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, >> where 'Y's are the sequential numbers for each type in order of >> detection, unless configured otherwise with tunables, see cam(4)). > > People might expect that if ata(4) numbering starts with ad4, ada4 > would be created. However on my machines I've seen ad4 get mapped to > ada0. Yes. With sequential I mean from 0 and up. :) What's about 4, I believe not so many people still remember what does it mean, and probably none for whom that reason is important now. :) -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 09:23:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1FC8106566B; Sun, 24 Apr 2011 09:23:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0BBA8FC12; Sun, 24 Apr 2011 09:23:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3O9N8RM025388; Sun, 24 Apr 2011 09:23:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3O9N8QG025386; Sun, 24 Apr 2011 09:23:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201104240923.p3O9N8QG025386@svn.freebsd.org> From: Alexander Motin Date: Sun, 24 Apr 2011 09:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 09:23:08 -0000 Author: mav Date: Sun Apr 24 09:23:08 2011 New Revision: 220983 URL: http://svn.freebsd.org/changeset/base/220983 Log: Explicitly note that device numbers are starting from zero. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) +++ head/UPDATING Sun Apr 24 09:23:08 2011 (r220983) @@ -28,8 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. removed and replaced by respective CAM drivers. If you are using ATA device names in /etc/fstab or other places, make sure to update them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, - where 'Y's are the sequential numbers for each type in order of - detection, unless configured otherwise with tunables, see cam(4)). + where 'Y's are the sequential numbers starting from zero for each type + in order of detection, unless configured otherwise with tunables, + see cam(4)). ataraid(4) functionality is now supported by the RAID GEOM class. To use it you can load geom_raid kernel module and use graid(8) tool From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 09:42:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76685106566B; Sun, 24 Apr 2011 09:42:41 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [IPv6:2a01:348:0:15:5d59:5c40:0:1]) by mx1.freebsd.org (Postfix) with ESMTP id 2B6C08FC18; Sun, 24 Apr 2011 09:42:41 +0000 (UTC) Received: from muon.cran.org.uk (localhost [127.0.0.1]) by muon.cran.org.uk (Postfix) with ESMTP id 6032BE6262; Sun, 24 Apr 2011 10:42:40 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cran.org.uk; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=mail; bh=+aTU7CuFjooM 07NW0oVMyNWyozs=; b=ajp5s8QmXgAaV6p7EBkJPFYGuEqvudlIZ6yOw5koYEmF ySDW13fgVjf02M/qZ6zYi3Za6RnyCQ+m7PBQLKB95NyW4SdbFE7fZ3/mYlHbH1C5 0/Jo60PxhhyJOQVKu8UScl6dQaTLxScyPuimnHJB9d5e41zcdbO647kMiYOOni0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=cran.org.uk; h=date:from:to :cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; q=dns; s=mail; b=QgmudG 2g0rHlZ/aVo9gcIMbsOEpzz1gba4TRCs7JNRv827yAURYYGxHMMGA+E/Z89ytOS+ WX/0h/sJMt1JU1CyatBEZb5pjnC+FeFJ64ljiWuD1zbsZrSkOka76ThNCwHOQWxd N6/Bpey9AOCNue2nszD+UNxrB4H33pESCvfac= Received: from unknown (188-222-18-231.zone13.bethere.co.uk [188.222.18.231]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id 133C0E61B6; Sun, 24 Apr 2011 10:42:40 +0100 (BST) Date: Sun, 24 Apr 2011 10:42:39 +0100 From: Bruce Cran To: Alexander Motin Message-ID: <20110424104239.000002ad@unknown> In-Reply-To: <4DB3EA47.5070304@FreeBSD.org> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <20110424100611.000020eb@unknown> <4DB3EA47.5070304@FreeBSD.org> X-Mailer: Claws Mail 3.7.8cvs47 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 09:42:41 -0000 On Sun, 24 Apr 2011 12:15:51 +0300 Alexander Motin wrote: > On 24.04.2011 12:06, Bruce Cran wrote: > > People might expect that if ata(4) numbering starts with ad4, ada4 > > would be created. However on my machines I've seen ad4 get mapped to > > ada0. > > Yes. With sequential I mean from 0 and up. :) Sorry I didn't read it properly and sent my reply before I noticed you said adX -> adaY, not adX -> adaX. -- Bruce Cran From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 09:57:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 1EA41106568A; Sun, 24 Apr 2011 09:57:36 +0000 (UTC) Date: Sun, 24 Apr 2011 09:57:36 +0000 From: Alexander Best To: Alexander Motin Message-ID: <20110424095736.GA92492@freebsd.org> References: <201104240923.p3O9N8QG025386@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104240923.p3O9N8QG025386@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 09:57:36 -0000 On Sun Apr 24 11, Alexander Motin wrote: > Author: mav > Date: Sun Apr 24 09:23:08 2011 > New Revision: 220983 > URL: http://svn.freebsd.org/changeset/base/220983 > > Log: > Explicitly note that device numbers are starting from zero. > > Modified: > head/UPDATING > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) > +++ head/UPDATING Sun Apr 24 09:23:08 2011 (r220983) > @@ -28,8 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. > removed and replaced by respective CAM drivers. If you are using > ATA device names in /etc/fstab or other places, make sure to update > them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, > - where 'Y's are the sequential numbers for each type in order of > - detection, unless configured otherwise with tunables, see cam(4)). > + where 'Y's are the sequential numbers starting from zero for each type > + in order of detection, unless configured otherwise with tunables, > + see cam(4)). maybe an extra sentence mentioning the fact that {geom,ufs}-labels and ufsids are preferred over device nodes nowadays would be a good idea? cheers. alex > > ataraid(4) functionality is now supported by the RAID GEOM class. > To use it you can load geom_raid kernel module and use graid(8) tool -- a13x From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:08:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2749B106566C; Sun, 24 Apr 2011 10:08:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 941AA8FC12; Sun, 24 Apr 2011 10:07:58 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3OA7tLo011164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 24 Apr 2011 13:07:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p3OA7sY6019098; Sun, 24 Apr 2011 13:07:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3OA7shq019097; Sun, 24 Apr 2011 13:07:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 24 Apr 2011 13:07:54 +0300 From: Kostik Belousov To: Alexander Motin Message-ID: <20110424100754.GD48734@deviant.kiev.zoral.com.ua> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="L4gFVV/CladpyON8" Content-Disposition: inline In-Reply-To: <201104240858.p3O8wwqT024628@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:08:00 -0000 --L4gFVV/CladpyON8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 24, 2011 at 08:58:58AM +0000, Alexander Motin wrote: > Author: mav > Date: Sun Apr 24 08:58:58 2011 > New Revision: 220982 > URL: http://svn.freebsd.org/changeset/base/220982 >=20 > Log: > Switch the GENERIC kernels for all architectures to the new CAM-based A= TA > stack. It means that all legacy ATA drivers are disabled and replaced by > respective CAM drivers. If you are using ATA device names in /etc/fstab= or > other places, make sure to update them respectively (adX -> adaY, > acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential > numbers for each type in order of detection, unless configured otherwise > with tunables, see cam(4)). > =20 > ataraid(4) functionality is now supported by the RAID GEOM class. > To use it you can load geom_raid kernel module and use graid(8) tool > for management. Instead of /dev/arX device names, use /dev/raid/rX. How many raid implementations, in particular, stripe and mirror ? Is gstripe/gmirror merged, or planned to be merged with geom_raid ? Does it make sense to merge if not yet ? --L4gFVV/CladpyON8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk2z9noACgkQC3+MBN1Mb4iW0wCg05hzfgYDUKwSOTKy1InovQDS tBAAnjE4y9zUQWM1biDkscDP11BDGiLo =TuWC -----END PGP SIGNATURE----- --L4gFVV/CladpyON8-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:13:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB0D106564A; Sun, 24 Apr 2011 10:13:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7C6E38FC08; Sun, 24 Apr 2011 10:13:20 +0000 (UTC) Received: by bwz12 with SMTP id 12so1767171bwz.13 for ; Sun, 24 Apr 2011 03:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=TBPXIpY7vRzd+WZqjOiSQwcw9/ORWc3mf3KKOpbAy0c=; b=UkaG15UJLoLYNCFAQ2rwgOOY9fliFOL0qaguFe+Hz3CkIqSVzXo4mRDYbrO5cGrWFo TRBDMtGzrirR8dcqTd/IxR6DWzgsGgyY+eNBZZTqMrBuEoBOlWtM09lRI3lkzfol6/Cw C/nwL9X+8W6jxpXdrKI/v8oR0C9nnuiHWtmZ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=bNfZUCzL+CGBza1X9j4DJzK3Duo7bqBpT3znSFkbkk/KjazlEYatVL5txaUXWbweIQ 9/oVbCjtxPikkdjhJrt+zIHnSOfDLe3imz8ElrQWK4il30jDXw46sAyuu/XU+cQkpV+D 7RsXaKw+0qT8z2k0evFzSz4OowpW2PR/WA/Ew= Received: by 10.204.19.20 with SMTP id y20mr2396058bka.170.1303639999706; Sun, 24 Apr 2011 03:13:19 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id u15sm64546bkf.4.2011.04.24.03.13.18 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 03:13:18 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB3F7BC.8090106@FreeBSD.org> Date: Sun, 24 Apr 2011 13:13:16 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Kostik Belousov References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <20110424100754.GD48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110424100754.GD48734@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:13:22 -0000 On 24.04.2011 13:07, Kostik Belousov wrote: > On Sun, Apr 24, 2011 at 08:58:58AM +0000, Alexander Motin wrote: >> Author: mav >> Date: Sun Apr 24 08:58:58 2011 >> New Revision: 220982 >> URL: http://svn.freebsd.org/changeset/base/220982 >> >> Log: >> Switch the GENERIC kernels for all architectures to the new CAM-based ATA >> stack. It means that all legacy ATA drivers are disabled and replaced by >> respective CAM drivers. If you are using ATA device names in /etc/fstab or >> other places, make sure to update them respectively (adX -> adaY, >> acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential >> numbers for each type in order of detection, unless configured otherwise >> with tunables, see cam(4)). >> >> ataraid(4) functionality is now supported by the RAID GEOM class. >> To use it you can load geom_raid kernel module and use graid(8) tool >> for management. Instead of /dev/arX device names, use /dev/raid/rX. > > How many raid implementations, in particular, stripe and mirror ? Same as before: one out, another in. > Is gstripe/gmirror merged, or planned to be merged with geom_raid ? > Does it make sense to merge if not yet ? It is definitely possible, but it is not done yet to not put all eggs in one basket. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:20:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6641065672; Sun, 24 Apr 2011 10:20:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id EC16C8FC08; Sun, 24 Apr 2011 10:20:39 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 00B2725D386D; Sun, 24 Apr 2011 10:20:38 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 33F12159D9FE; Sun, 24 Apr 2011 10:20:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id Fo438KGhXj-I; Sun, 24 Apr 2011 10:20:37 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id CB01B159D9F0; Sun, 24 Apr 2011 10:20:36 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201104240858.p3O8wwqT024628@svn.freebsd.org> Date: Sun, 24 Apr 2011 10:20:35 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:20:40 -0000 On Apr 24, 2011, at 8:58 AM, Alexander Motin wrote: > Author: mav > Date: Sun Apr 24 08:58:58 2011 > New Revision: 220982 > URL: http://svn.freebsd.org/changeset/base/220982 >=20 > Log: > Switch the GENERIC kernels for all architectures to the new CAM-based = ATA > stack. It means that all legacy ATA drivers are disabled and replaced = by > respective CAM drivers. If you are using ATA device names in = /etc/fstab or > other places, make sure to update them respectively (adX -> adaY, > acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential > numbers for each type in order of detection, unless configured = otherwise > with tunables, see cam(4)). Are you going to address that on updating magic will make it work within = the next 2-4 weeks? If you will not then thanks for screwing 50% of our users and please = back this out again. > ataraid(4) functionality is now supported by the RAID GEOM class. > To use it you can load geom_raid kernel module and use graid(8) tool > for management. Instead of /dev/arX device names, use /dev/raid/rX. >=20 > Modified: > head/UPDATING > head/sys/amd64/conf/GENERIC > head/sys/arm/conf/AVILA > head/sys/arm/conf/CAMBRIA > head/sys/arm/conf/CRB > head/sys/arm/conf/DB-78XXX > head/sys/arm/conf/DB-88F5XXX > head/sys/arm/conf/DB-88F6XXX > head/sys/arm/conf/EP80219 > head/sys/arm/conf/IQ31244 > head/sys/arm/conf/TS7800 > head/sys/conf/NOTES > head/sys/i386/conf/GENERIC > head/sys/i386/conf/XBOX > head/sys/ia64/conf/GENERIC > head/sys/mips/conf/MALTA > head/sys/mips/conf/MALTA64 > head/sys/mips/conf/OCTEON1 > head/sys/mips/conf/std.SWARM > head/sys/mips/malta/std.malta > head/sys/pc98/conf/GENERIC > head/sys/powerpc/conf/GENERIC > head/sys/powerpc/conf/GENERIC64 > head/sys/powerpc/conf/MPC85XX > head/sys/sparc64/conf/GENERIC > head/sys/sun4v/conf/GENERIC --=20 Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:41:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F060106564A; Sun, 24 Apr 2011 10:41:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E66D8FC0C; Sun, 24 Apr 2011 10:41:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OAfDHM027700; Sun, 24 Apr 2011 10:41:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OAfDsN027698; Sun, 24 Apr 2011 10:41:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201104241041.p3OAfDsN027698@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 24 Apr 2011 10:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220984 - head/sys/geom/eli X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:41:13 -0000 Author: pjd Date: Sun Apr 24 10:41:13 2011 New Revision: 220984 URL: http://svn.freebsd.org/changeset/base/220984 Log: One key is expected from providers smaller than or equal to (2^20)*sectorsize bytes. Remove bogus assertion and while here remove another too obvious assertion. Reported by: Fabian Keil MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli_key_cache.c Modified: head/sys/geom/eli/g_eli_key_cache.c ============================================================================== --- head/sys/geom/eli/g_eli_key_cache.c Sun Apr 24 09:23:08 2011 (r220983) +++ head/sys/geom/eli/g_eli_key_cache.c Sun Apr 24 10:41:13 2011 (r220984) @@ -263,12 +263,6 @@ g_eli_key_hold(struct g_eli_softc *sc, o if ((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) != 0) return (sc->sc_ekey); - KASSERT(sc->sc_ekeys_total > 1, ("%s: sc_ekeys_total=%ju", __func__, - (uintmax_t)sc->sc_ekeys_total)); - KASSERT((sc->sc_flags & G_ELI_FLAG_SINGLE_KEY) == 0, - ("%s: SINGLE_KEY flag set, but sc_ekeys_total=%ju", __func__, - (uintmax_t)sc->sc_ekeys_total)); - /* We switch key every 2^G_ELI_KEY_SHIFT blocks. */ keyno = (offset >> G_ELI_KEY_SHIFT) / blocksize; From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:44:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F328E1065674; Sun, 24 Apr 2011 10:44:15 +0000 (UTC) (envelope-from mack@macktronics.com) Received: from coco.macktronics.com (coco.macktronics.com [209.181.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id CC7778FC13; Sun, 24 Apr 2011 10:44:15 +0000 (UTC) Received: from coco.macktronics.com (coco.macktronics.com [209.181.253.65]) by coco.macktronics.com (Postfix) with ESMTP id B536D4AC40; Sun, 24 Apr 2011 05:25:00 -0500 (CDT) Date: Sun, 24 Apr 2011 05:25:00 -0500 (CDT) From: Dan Mack To: Alexander Best In-Reply-To: <20110424095736.GA92492@freebsd.org> Message-ID: <20110424051747.S1757@coco.macktronics.com> References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424095736.GA92492@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:44:16 -0000 On Sun, 24 Apr 2011, Alexander Best wrote: > On Sun Apr 24 11, Alexander Motin wrote: >> Author: mav >> Date: Sun Apr 24 09:23:08 2011 >> New Revision: 220983 >> URL: http://svn.freebsd.org/changeset/base/220983 >> >> Log: >> Explicitly note that device numbers are starting from zero. >> >> Modified: >> head/UPDATING >> >> Modified: head/UPDATING >> ============================================================================== >> --- head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) >> +++ head/UPDATING Sun Apr 24 09:23:08 2011 (r220983) >> @@ -28,8 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. >> removed and replaced by respective CAM drivers. If you are using >> ATA device names in /etc/fstab or other places, make sure to update >> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, >> - where 'Y's are the sequential numbers for each type in order of >> - detection, unless configured otherwise with tunables, see cam(4)). >> + where 'Y's are the sequential numbers starting from zero for each type >> + in order of detection, unless configured otherwise with tunables, >> + see cam(4)). > > maybe an extra sentence mentioning the fact that {geom,ufs}-labels and ufsids > are preferred over device nodes nowadays would be a good idea? > > cheers. > alex For those of us using a ZFS root pool built out of /dev/gpt/ devices, will these automagically pick up the new names? Dan From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:47:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 381BB106566B; Sun, 24 Apr 2011 10:47:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D2698FC13; Sun, 24 Apr 2011 10:47:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OAlvVc027928; Sun, 24 Apr 2011 10:47:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OAluuU027924; Sun, 24 Apr 2011 10:47:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201104241047.p3OAluuU027924@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 24 Apr 2011 10:47:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220985 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:47:57 -0000 Author: kib Date: Sun Apr 24 10:47:56 2011 New Revision: 220985 URL: http://svn.freebsd.org/changeset/base/220985 Log: VFS sometimes is unable to inactivate a vnode when vnode use count goes to zero. E.g., the vnode might be only shared-locked at the time of vput() call. Such vnodes are kept in the hash, so they can be found later. If ffs_valloc() allocated an inode that has its vnode cached in hash, and still owing the inactivation, then vget() call from ffs_valloc() clears VI_OWEINACT, and then the vnode is reused for the newly allocated inode. The problem is, the vnode is not reclaimed before it is put to the new use. ffs_valloc() recycles vnode vm object, but this is not enough. In particular, at least v_vflag should be cleared, and several bits of UFS state need to be removed. It is very inconvenient to call vgone() at this point. Instead, move some parts of ufs_reclaim() into helper function ufs_prepare_reclaim(), and call the helper from VOP_RECLAIM and ffs_valloc(). Reviewed by: mckusick Tested by: pho MFC after: 3 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ufs/ufs_extern.h head/sys/ufs/ufs/ufs_inode.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sun Apr 24 10:41:13 2011 (r220984) +++ head/sys/ufs/ffs/ffs_alloc.c Sun Apr 24 10:47:56 2011 (r220985) @@ -1012,8 +1012,9 @@ dup_alloc: ip->i_din2->di_birthtime = ts.tv_sec; ip->i_din2->di_birthnsec = ts.tv_nsec; } + ufs_prepare_reclaim(*vpp); ip->i_flag = 0; - vnode_destroy_vobject(*vpp); + (*vpp)->v_vflag = 0; (*vpp)->v_type = VNON; if (fs->fs_magic == FS_UFS2_MAGIC) (*vpp)->v_op = &ffs_vnodeops2; Modified: head/sys/ufs/ufs/ufs_extern.h ============================================================================== --- head/sys/ufs/ufs/ufs_extern.h Sun Apr 24 10:41:13 2011 (r220984) +++ head/sys/ufs/ufs/ufs_extern.h Sun Apr 24 10:47:56 2011 (r220985) @@ -76,6 +76,7 @@ int ufs_inactive(struct vop_inactive_ar int ufs_init(struct vfsconf *); void ufs_itimes(struct vnode *vp); int ufs_lookup(struct vop_cachedlookup_args *); +void ufs_prepare_reclaim(struct vnode *vp); int ufs_readdir(struct vop_readdir_args *); int ufs_reclaim(struct vop_reclaim_args *); void ffs_snapgone(struct inode *); Modified: head/sys/ufs/ufs/ufs_inode.c ============================================================================== --- head/sys/ufs/ufs/ufs_inode.c Sun Apr 24 10:41:13 2011 (r220984) +++ head/sys/ufs/ufs/ufs_inode.c Sun Apr 24 10:47:56 2011 (r220985) @@ -172,6 +172,31 @@ out: return (error); } +void +ufs_prepare_reclaim(struct vnode *vp) +{ + struct inode *ip; +#ifdef QUOTA + int i; +#endif + + ip = VTOI(vp); + + vnode_destroy_vobject(vp); +#ifdef QUOTA + for (i = 0; i < MAXQUOTAS; i++) { + if (ip->i_dquot[i] != NODQUOT) { + dqrele(vp, ip->i_dquot[i]); + ip->i_dquot[i] = NODQUOT; + } + } +#endif +#ifdef UFS_DIRHASH + if (ip->i_dirhash != NULL) + ufsdirhash_free(ip); +#endif +} + /* * Reclaim an inode so that it can be used for other purposes. */ @@ -185,14 +210,9 @@ ufs_reclaim(ap) struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); struct ufsmount *ump = ip->i_ump; -#ifdef QUOTA - int i; -#endif - /* - * Destroy the vm object and flush associated pages. - */ - vnode_destroy_vobject(vp); + ufs_prepare_reclaim(vp); + if (ip->i_flag & IN_LAZYMOD) ip->i_flag |= IN_MODIFIED; UFS_UPDATE(vp, 0); @@ -200,21 +220,7 @@ ufs_reclaim(ap) * Remove the inode from its hash chain. */ vfs_hash_remove(vp); - /* - * Purge old data structures associated with the inode. - */ -#ifdef QUOTA - for (i = 0; i < MAXQUOTAS; i++) { - if (ip->i_dquot[i] != NODQUOT) { - dqrele(vp, ip->i_dquot[i]); - ip->i_dquot[i] = NODQUOT; - } - } -#endif -#ifdef UFS_DIRHASH - if (ip->i_dirhash != NULL) - ufsdirhash_free(ip); -#endif + /* * Lock the clearing of v_data so ffs_lock() can inspect it * prior to obtaining the lock. From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:48:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E340A106564A; Sun, 24 Apr 2011 10:48:20 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BC2808FC08; Sun, 24 Apr 2011 10:48:20 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 5E02846B49; Sun, 24 Apr 2011 06:48:20 -0400 (EDT) Date: Sun, 24 Apr 2011 11:48:20 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Motin In-Reply-To: <201104240858.p3O8wwqT024628@svn.freebsd.org> Message-ID: References: <201104240858.p3O8wwqT024628@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:48:21 -0000 On Sun, 24 Apr 2011, Alexander Motin wrote: > Author: mav > Date: Sun Apr 24 08:58:58 2011 > New Revision: 220982 > URL: http://svn.freebsd.org/changeset/base/220982 > > Log: > Switch the GENERIC kernels for all architectures to the new CAM-based ATA > stack. It means that all legacy ATA drivers are disabled and replaced by > respective CAM drivers. If you are using ATA device names in /etc/fstab or > other places, make sure to update them respectively (adX -> adaY, > acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential > numbers for each type in order of detection, unless configured otherwise > with tunables, see cam(4)). > > ataraid(4) functionality is now supported by the RAID GEOM class. > To use it you can load geom_raid kernel module and use graid(8) tool > for management. Instead of /dev/arX device names, use /dev/raid/rX. I'm very pleased to see a continued movement towards the new ATA code; it offers clear benefits to all of our users, and is definitely something we want done for 9.0. Could you say more about the migration strategy for users? I recall that when you proposed throwing this switch, several strategies were discussed (likely in combination to handle both the immediate upgrade stumble issue and a longer-term migration): (1) Teach new ata parts to replicate the old naming convention in 99.9% of cases. Or some suppport module that creates the required symlinks if loaded (and we load it by default in 9.0, phasing it out later with appropriate boot-time warnings for 6-12 months). Obviously, this would be best-effort, but if it takes us from a 40% upgrade failure to a 1% upgrade failure, that's a big deal. (2) Over time, provide a migration to fstab naming storage targets by volume ID / name / serial number, rather than by hardware path. A good long-term strategy but one that requires changes to the installer, upgrade path, etc. (3) Teach freebsd-update/installer/etc to recognise *before* a new kernel is installed whether the current configuration will require hand-holding. (4) Thinking pretty hard about the roll-back path to avoid stumbles when there's a problem following a kernel update. In the past, linking kernel feature updates to /etc or userspace updates has caused significant issues for our users, who reasonably expect to follow our normal "install the kernel, reboot, let it sit for a week" path. What is your plan for implementing some combination of these (or did I miss the commits that brought them in already)? In the past, we've seen upgrade path problems dislodge users, and since then, we've grown an increased assumption of ease-of-upgrade that can be managed automatically by tools like freebsd-update. Breaking the automated upgrade (and roll-back) path would be extremely problematic. Robert From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:49:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49BBC1065672; Sun, 24 Apr 2011 10:49:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 24D158FC18; Sun, 24 Apr 2011 10:49:19 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id D321C46B49; Sun, 24 Apr 2011 06:49:18 -0400 (EDT) Date: Sun, 24 Apr 2011 11:49:18 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Best In-Reply-To: <20110424095736.GA92492@freebsd.org> Message-ID: References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424095736.GA92492@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:49:19 -0000 On Sun, 24 Apr 2011, Alexander Best wrote: >> ============================================================================== >> --- head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) >> +++ head/UPDATING Sun Apr 24 09:23:08 2011 (r220983) >> @@ -28,8 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. >> removed and replaced by respective CAM drivers. If you are using >> ATA device names in /etc/fstab or other places, make sure to update >> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, >> - where 'Y's are the sequential numbers for each type in order of >> - detection, unless configured otherwise with tunables, see cam(4)). >> + where 'Y's are the sequential numbers starting from zero for each type >> + in order of detection, unless configured otherwise with tunables, >> + see cam(4)). > > maybe an extra sentence mentioning the fact that {geom,ufs}-labels and > ufsids are preferred over device nodes nowadays would be a good idea? If this is true, that's what our installer needs to do. Does our installer do that? (In general, a reasonable definition of "preferred" is "what the installer does" -- if that's not the case, it's a serious bug.) Robert From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 10:50:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 153A4106564A; Sun, 24 Apr 2011 10:50:04 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 36B458FC0A; Sun, 24 Apr 2011 10:50:02 +0000 (UTC) Received: by bwz12 with SMTP id 12so1779174bwz.13 for ; Sun, 24 Apr 2011 03:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=kIQl2FQwuKxoG0KIY7KMN6soYOpkBBr5HYPPUHaCZTI=; b=TiJ6K3Y6nElS8aAJRMfKJOr81kQNZuHxJ1pGL+yfe3zgW8Fbq5KeekrVEBtBd139+g rPOH7VYzb02xHUvvDjwZ3CK325iu+OpqfH+J+W92MPFO/c7EkNHC7YXtKKWn6HCffVtJ TFfIr0gbUT7/AQOx7PoupTqDDSrCIddaWFmLU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=YNKaKv4K8DGyOX5dM3nxQZx9Txgqsoj9j/pWRz8Ggns9E95yzidoCUePtoMbvISUc7 Dl03A3QeTOHdKht+R3pwJB8QVBC35VwtBrDBsfIDKIkVJ30sKWSMbSsBEZJDz9g5HZr2 HsfTV2xhw5aEozIEXsuFmkxNSixQSDBHTq+2I= Received: by 10.204.20.79 with SMTP id e15mr2507420bkb.147.1303642153130; Sun, 24 Apr 2011 03:49:13 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id y22sm2676567bku.20.2011.04.24.03.49.11 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 03:49:12 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB40026.5030405@FreeBSD.org> Date: Sun, 24 Apr 2011 13:49:10 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> In-Reply-To: <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 10:50:04 -0000 On 24.04.2011 13:20, Bjoern A. Zeeb wrote: > On Apr 24, 2011, at 8:58 AM, Alexander Motin wrote: >> Author: mav >> Date: Sun Apr 24 08:58:58 2011 >> New Revision: 220982 >> URL: http://svn.freebsd.org/changeset/base/220982 >> >> Log: >> Switch the GENERIC kernels for all architectures to the new CAM-based ATA >> stack. It means that all legacy ATA drivers are disabled and replaced by >> respective CAM drivers. If you are using ATA device names in /etc/fstab or >> other places, make sure to update them respectively (adX -> adaY, >> acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential >> numbers for each type in order of detection, unless configured otherwise >> with tunables, see cam(4)). > > > Are you going to address that on updating magic will make it work within the next 2-4 weeks? s/ad[0-9]+/ada0/ should fit 90%. A bit more sophisticated script should fit most. In what place should I put that magic? > If you will not then thanks for screwing 50% of our users and please back this out again. Reverting is not an option. _Constructive_ propositions are welcome. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 11:00:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A596106564A; Sun, 24 Apr 2011 11:00:40 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 501488FC0C; Sun, 24 Apr 2011 11:00:40 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 04BAF46B49; Sun, 24 Apr 2011 07:00:40 -0400 (EDT) Date: Sun, 24 Apr 2011 12:00:39 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Motin In-Reply-To: <4DB40026.5030405@FreeBSD.org> Message-ID: References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> <4DB40026.5030405@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 11:00:40 -0000 On Sun, 24 Apr 2011, Alexander Motin wrote: >> Are you going to address that on updating magic will make it work within >> the next 2-4 weeks? > > s/ad[0-9]+/ada0/ should fit 90%. A bit more sophisticated script should fit > most. In what place should I put that magic? > >> If you will not then thanks for screwing 50% of our users and please back >> this out again. > > Reverting is not an option. _Constructive_ propositions are welcome. Hi Mav: It is the policy of this project that the release engineering team has final authority over what ships in a release. It is entirely within scope to revert this change for 9.0 if issues with the upgrade path are not addressed. My hope also that this path can be entirely avoided through a rapid addressing of upgrade path issues that have been known (and discussed on the mailing lists extensively) since you posted about the work on the public mailing lists. I agree with Bjoern that it is critical to address these issues in a timely manner -- our users depend on reliable and easy upgrades, and it seems (on face value) that significant work remains to be done to make that possible. Our release is increasingly close, and it's important we keep the tree as stable as possible so that merges of other straggling features can go uneventfully. Robert From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 11:10:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09A9F106566C; Sun, 24 Apr 2011 11:10:54 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id D49708FC0C; Sun, 24 Apr 2011 11:10:53 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 8F2D046B58; Sun, 24 Apr 2011 07:10:53 -0400 (EDT) Date: Sun, 24 Apr 2011 12:10:53 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Motin In-Reply-To: Message-ID: References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> <4DB40026.5030405@FreeBSD.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 11:10:54 -0000 On Sun, 24 Apr 2011, Robert Watson wrote: > I agree with Bjoern that it is critical to address these issues in a timely > manner -- our users depend on reliable and easy upgrades, and it seems (on > face value) that significant work remains to be done to make that possible. > Our release is increasingly close, and it's important we keep the tree as > stable as possible so that merges of other straggling features can go > uneventfully. Just to follow up on the point: it's very important that the new ATA driver see as much testing exposure as possible -- that's one reason why paying close attention to the upgrade path. If we knock users off 9-CURRENT due to upgrade problems, then we'll reduce testing for this feature just as much as any others. This is a good reason to resolve the problems as quickly as possible! Robert From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 11:49:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 137CD106568D; Sun, 24 Apr 2011 11:49:19 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 084D18FC1B; Sun, 24 Apr 2011 11:49:17 +0000 (UTC) Received: by bwz12 with SMTP id 12so1798187bwz.13 for ; Sun, 24 Apr 2011 04:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=CkDt7KHNLROE+C/0J70nL6Xhhn+hh6cYEgCZ+qPnKDk=; b=vJucIhyXn2pK+sHYS78lYLbKFYiC0SZBlOgyagSNJUBi3rIvQtByN4a3GQYxOmi9IS ffAQ/Ie8PDbFIndReq3smg5chrAAKSgOrveEalmbxw9KpdkgKK/Y1hTBE/ttuhJShP8B Vozss2tWm4ns13hnYS31Wy0RDj/3TXr97L834= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=U/Xu68zQNL8McL7AfY/5iL6wukUW+YWhV+YCKFrj5aSw8unM/h/C5hx0HDnnqJiqRO /ULvvO+CfCdhYI3mL+BEcUdMHoZO4WhnuLZpyYQD5V/jA6flFlHF8eascMbhCLgXZ8YK trwxwgsKr6taNgTB8aIhIvYqfoqTvCXTzaxPU= Received: by 10.204.7.156 with SMTP id d28mr2545076bkd.28.1303645756650; Sun, 24 Apr 2011 04:49:16 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id c11sm2705938bkc.2.2011.04.24.04.49.15 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 04:49:16 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB40E39.5090905@FreeBSD.org> Date: Sun, 24 Apr 2011 14:49:13 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Robert Watson References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> <4DB40026.5030405@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 11:49:19 -0000 On 24.04.2011 14:00, Robert Watson wrote: > On Sun, 24 Apr 2011, Alexander Motin wrote: >>> Are you going to address that on updating magic will make it work >>> within the next 2-4 weeks? >> >> s/ad[0-9]+/ada0/ should fit 90%. A bit more sophisticated script >> should fit most. In what place should I put that magic? >> >>> If you will not then thanks for screwing 50% of our users and please >>> back this out again. >> >> Reverting is not an option. _Constructive_ propositions are welcome. > > It is the policy of this project that the release engineering team has > final authority over what ships in a release. It is entirely within > scope to revert this change for 9.0 if issues with the upgrade path are > not addressed. My hope also that this path can be entirely avoided > through a rapid addressing of upgrade path issues that have been known > (and discussed on the mailing lists extensively) since you posted about > the work on the public mailing lists. > > I agree with Bjoern that it is critical to address these issues in a > timely manner -- our users depend on reliable and easy upgrades, and it > seems (on face value) that significant work remains to be done to make > that possible. Our release is increasingly close, and it's important we > keep the tree as stable as possible so that merges of other straggling > features can go uneventfully. I am asking for excuse if my tone was overly strict. It was not my real intention to offend anybody. May be inside I am indeed overreacting a bit on proposition to revert with no alternative things that I have put my heart into, which are broadly accepted by users, which I announced on the list few days ago and got no objections. I am sorry for that. I do worry about possible complications during migration process. And obviously this is not an easy question, as soon as it wasn't solved during so much time. I will gladly accept any help or real ideas people can provide. I just don't like to feel it my own problem. I am not doing it for myself. It would be nice to see some friendly support instead. Thank you. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 12:24:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A2EE106564A; Sun, 24 Apr 2011 12:24:38 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 83A398FC17; Sun, 24 Apr 2011 12:24:37 +0000 (UTC) Received: by bwz12 with SMTP id 12so1810146bwz.13 for ; Sun, 24 Apr 2011 05:24:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=4OH98pWCol5il34UKbSZGSIo6RdFNM1M2w0B410ljKQ=; b=W1nXl4i5F/MOqIZOs+qYSuNp4+EZgmunU9ZG7NX/wpLe7avsg05UcLioaevaBAAe43 FuXeCSz7ZapjYD03lnNjaL8YoQ/TEizE35nTtQxMlVe9Fn/pQLAUwJKLsJpZI34H257T YhDh+NWUuncxHwUwTJUzzwvuUjSi2bg2mqlss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=iK9ZO6ZPFbApnY3Tk3g17I2EGgupKde6FhAMoL4z26GHhO8LegABC4jSE1SwHqS+OR aWdlcYLVDY9s/gQH5NDMPAo6qqXHk066/xqKtByEuMxjzEboOj4sE58T3yc0L+HmHLev 94NMRNrzdgyzJzKZu7I0C38PC8Q+eNt+0P24U= Received: by 10.204.3.146 with SMTP id 18mr2569856bkn.1.1303647875737; Sun, 24 Apr 2011 05:24:35 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id q24sm2713164bks.21.2011.04.24.05.24.34 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 05:24:35 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB41681.9020600@FreeBSD.org> Date: Sun, 24 Apr 2011 15:24:33 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Dan Mack References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424095736.GA92492@freebsd.org> <20110424051747.S1757@coco.macktronics.com> In-Reply-To: <20110424051747.S1757@coco.macktronics.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexander Best , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 12:24:38 -0000 On 24.04.2011 13:25, Dan Mack wrote: > On Sun, 24 Apr 2011, Alexander Best wrote: >> On Sun Apr 24 11, Alexander Motin wrote: >>> Author: mav >>> Date: Sun Apr 24 09:23:08 2011 >>> New Revision: 220983 >>> URL: http://svn.freebsd.org/changeset/base/220983 >>> >>> Log: >>> Explicitly note that device numbers are starting from zero. >>> >>> Modified: >>> head/UPDATING >>> >>> Modified: head/UPDATING >>> ============================================================================== >>> >>> --- head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) >>> +++ head/UPDATING Sun Apr 24 09:23:08 2011 (r220983) >>> @@ -28,8 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. >>> removed and replaced by respective CAM drivers. If you are using >>> ATA device names in /etc/fstab or other places, make sure to update >>> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, >>> - where 'Y's are the sequential numbers for each type in order of >>> - detection, unless configured otherwise with tunables, see cam(4)). >>> + where 'Y's are the sequential numbers starting from zero for each type >>> + in order of detection, unless configured otherwise with tunables, >>> + see cam(4)). >> >> maybe an extra sentence mentioning the fact that {geom,ufs}-labels and >> ufsids >> are preferred over device nodes nowadays would be a good idea? > > For those of us using a ZFS root pool built out of /dev/gpt/ devices, > will these automagically pick up the new names? You should not notice transition. GPT labels should stay as they were. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 13:18:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66590106566B; Sun, 24 Apr 2011 13:18:24 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 0F4EB8FC14; Sun, 24 Apr 2011 13:18:23 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 76C2C45EA4; Sun, 24 Apr 2011 15:18:22 +0200 (CEST) Received: from localhost (mail.garage.freebsd.pl [10.0.4.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id AA70B45684; Sun, 24 Apr 2011 15:18:16 +0200 (CEST) Date: Sun, 24 Apr 2011 15:18:04 +0200 From: Pawel Jakub Dawidek To: Dan Mack Message-ID: <20110424131804.GB1872@garage.freebsd.pl> References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424095736.GA92492@freebsd.org> <20110424051747.S1757@coco.macktronics.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m51xatjYGsM+13rf" Content-Disposition: inline In-Reply-To: <20110424051747.S1757@coco.macktronics.com> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, Alexander Best , Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 13:18:24 -0000 --m51xatjYGsM+13rf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 24, 2011 at 05:25:00AM -0500, Dan Mack wrote: > For those of us using a ZFS root pool built out of /dev/gpt/ > devices, will these automagically pick up the new names? Even if you use adX devices in your ZFS pool and they will suddenly change to adaY, ZFS should detect this properly and no manual intervention should be needed. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --m51xatjYGsM+13rf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk20IwsACgkQForvXbEpPzQIdACfVFAswjkt/b2G3VVWiWO4n0+1 zR4AmQGp8ZFAu+3hU/SGLjUMJ5KVWZdM =6Fcd -----END PGP SIGNATURE----- --m51xatjYGsM+13rf-- From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 13:22:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D4CA106564A; Sun, 24 Apr 2011 13:22:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DB038FC0C; Sun, 24 Apr 2011 13:22:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3ODMFbN033360; Sun, 24 Apr 2011 13:22:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3ODMFMa033358; Sun, 24 Apr 2011 13:22:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201104241322.p3ODMFMa033358@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 24 Apr 2011 13:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220987 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 13:22:15 -0000 Author: kib Date: Sun Apr 24 13:22:14 2011 New Revision: 220987 URL: http://svn.freebsd.org/changeset/base/220987 Log: Fix typo. MFC after: 3 days Modified: head/sys/sys/systm.h Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sun Apr 24 11:01:42 2011 (r220986) +++ head/sys/sys/systm.h Sun Apr 24 13:22:14 2011 (r220987) @@ -149,7 +149,7 @@ int nullop(void); int eopnotsupp(void); int ureadc(int, struct uio *); void hashdestroy(void *, struct malloc_type *, u_long); -void *hashinit(int count, struct malloc_type *type, u_long *hashmark); +void *hashinit(int count, struct malloc_type *type, u_long *hashmask); void *hashinit_flags(int count, struct malloc_type *type, u_long *hashmask, int flags); #define HASH_NOWAIT 0x00000001 From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 14:14:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72F21106566C; Sun, 24 Apr 2011 14:14:07 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 172A58FC08; Sun, 24 Apr 2011 14:14:06 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 329B75811B; Sun, 24 Apr 2011 09:14:06 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id kReVdMAqmRLn; Sun, 24 Apr 2011 09:14:06 -0500 (CDT) Received: from wanderer.tachypleus.net (unknown [76.210.65.155]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4C21D5811A; Sun, 24 Apr 2011 09:14:05 -0500 (CDT) Message-ID: <4DB4302B.5050501@freebsd.org> Date: Sun, 24 Apr 2011 09:14:03 -0500 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110317 Thunderbird/3.1.9 MIME-Version: 1.0 To: Robert Watson References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424095736.GA92492@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, Alexander Best , Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 14:14:07 -0000 On 04/24/11 05:49, Robert Watson wrote: > > On Sun, 24 Apr 2011, Alexander Best wrote: > >>> ============================================================================== >>> >>> --- head/UPDATING Sun Apr 24 08:58:58 2011 (r220982) >>> +++ head/UPDATING Sun Apr 24 09:23:08 2011 (r220983) >>> @@ -28,8 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. >>> removed and replaced by respective CAM drivers. If you are using >>> ATA device names in /etc/fstab or other places, make sure to update >>> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, >>> - where 'Y's are the sequential numbers for each type in order of >>> - detection, unless configured otherwise with tunables, see cam(4)). >>> + where 'Y's are the sequential numbers starting from zero for each type >>> + in order of detection, unless configured otherwise with tunables, >>> + see cam(4)). >> >> maybe an extra sentence mentioning the fact that {geom,ufs}-labels and >> ufsids are preferred over device nodes nowadays would be a good idea? > > If this is true, that's what our installer needs to do. Does our > installer do that? > > (In general, a reasonable definition of "preferred" is "what the > installer does" -- if that's not the case, it's a serious bug.) Our installer does not do that. I outlined the reasons in another earlier email, but the summary is that labels seem to be somewhat fragile. Gpart supports a partition-generic labeling interface for three schemes: PC98, GPT, and APM. The installer now supports setting labels on all of these. The appearance of labeled geom providers happens in a different module, glabel, which relies on a totally parallel parse of the partition map. As a result, labeled partitions appearing in /dev works only on GPT volumes, and even then, due to endianness bugs, only on little-endian platforms. Glabel is also not guaranteed available by gpart, and I'm a little dubious that reparses happen at the correct time with 100% reliability. The other, more minor, difficulty, is that it is somewhat difficult to get the labeled provider name from the gpart provider (you have to try to cross-correlate names, and there may be many label providers to choose from for the same partition). If gpart were modified to provide label providers itself based on its generic labeling mechanism, and to provide the name of those providers in its config XML, using labels by default in the installer would be trivial and I would have it in the tree within 5 minutes of getting that commit mail. Unfortunately, I don't have time to do the requisite gpart modifications (which probably aren't that hard) at this time. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 14:50:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9AE1106566B; Sun, 24 Apr 2011 14:50:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F47D8FC14; Sun, 24 Apr 2011 14:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OEoTYa035855; Sun, 24 Apr 2011 14:50:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OEoT7W035852; Sun, 24 Apr 2011 14:50:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104241450.p3OEoT7W035852@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Apr 2011 14:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220988 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 14:50:29 -0000 Author: adrian Date: Sun Apr 24 14:50:29 2011 New Revision: 220988 URL: http://svn.freebsd.org/changeset/base/220988 Log: Eliminate code duplication between AR5416/AR9160/AR9280 and AR9285. Writing the TX power registers is the same between all of these chips and later NICs (AR9287, AR9271 USB, etc.) so this will reduce code duplication when those NICs are added to the HAL. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 24 13:22:14 2011 (r220987) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 24 14:50:29 2011 (r220988) @@ -268,6 +268,8 @@ extern void ar5416WritePdadcValues(struc extern HAL_BOOL ar5416SetPowerCalTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset); +extern void ar5416WriteTxPowerRateRegisters(struct ath_hal *ah, + const struct ieee80211_channel *chan, const int16_t ratesArray[]); extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 24 13:22:14 2011 (r220987) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 24 14:50:29 2011 (r220988) @@ -795,6 +795,99 @@ ar5416GetChipPowerLimits(struct ath_hal } /************************************************************** + * ar5416WriteTxPowerRateRegisters + * + * Write the TX power rate registers from the raw values given + * in ratesArray[]. + * + * The CCK and HT40 rate registers are only written if needed. + * HT20 and 11g/11a OFDM rate registers are always written. + * + * The values written are raw values which should be written + * to the registers - so it's up to the caller to pre-adjust + * them (eg CCK power offset value, or Merlin TX power offset, + * etc.) + */ +void +ar5416WriteTxPowerRateRegisters(struct ath_hal *ah, + const struct ieee80211_channel *chan, const int16_t ratesArray[]) +{ +#define POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) + + /* Write the OFDM power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE1, + POW_SM(ratesArray[rate18mb], 24) + | POW_SM(ratesArray[rate12mb], 16) + | POW_SM(ratesArray[rate9mb], 8) + | POW_SM(ratesArray[rate6mb], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE2, + POW_SM(ratesArray[rate54mb], 24) + | POW_SM(ratesArray[rate48mb], 16) + | POW_SM(ratesArray[rate36mb], 8) + | POW_SM(ratesArray[rate24mb], 0) + ); + + if (IEEE80211_IS_CHAN_2GHZ(chan)) { + /* Write the CCK power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE3, + POW_SM(ratesArray[rate2s], 24) + | POW_SM(ratesArray[rate2l], 16) + | POW_SM(ratesArray[rateXr], 8) /* XR target power */ + | POW_SM(ratesArray[rate1l], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE4, + POW_SM(ratesArray[rate11s], 24) + | POW_SM(ratesArray[rate11l], 16) + | POW_SM(ratesArray[rate5_5s], 8) + | POW_SM(ratesArray[rate5_5l], 0) + ); + HALDEBUG(ah, HAL_DEBUG_RESET, + "%s AR_PHY_POWER_TX_RATE3=0x%x AR_PHY_POWER_TX_RATE4=0x%x\n", + __func__, OS_REG_READ(ah,AR_PHY_POWER_TX_RATE3), + OS_REG_READ(ah,AR_PHY_POWER_TX_RATE4)); + } + + /* Write the HT20 power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE5, + POW_SM(ratesArray[rateHt20_3], 24) + | POW_SM(ratesArray[rateHt20_2], 16) + | POW_SM(ratesArray[rateHt20_1], 8) + | POW_SM(ratesArray[rateHt20_0], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE6, + POW_SM(ratesArray[rateHt20_7], 24) + | POW_SM(ratesArray[rateHt20_6], 16) + | POW_SM(ratesArray[rateHt20_5], 8) + | POW_SM(ratesArray[rateHt20_4], 0) + ); + + if (IEEE80211_IS_CHAN_HT40(chan)) { + /* Write the HT40 power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE7, + POW_SM(ratesArray[rateHt40_3], 24) + | POW_SM(ratesArray[rateHt40_2], 16) + | POW_SM(ratesArray[rateHt40_1], 8) + | POW_SM(ratesArray[rateHt40_0], 0) + ); + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE8, + POW_SM(ratesArray[rateHt40_7], 24) + | POW_SM(ratesArray[rateHt40_6], 16) + | POW_SM(ratesArray[rateHt40_5], 8) + | POW_SM(ratesArray[rateHt40_4], 0) + ); + /* Write the Dup/Ext 40 power per rate set */ + OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE9, + POW_SM(ratesArray[rateExtOfdm], 24) + | POW_SM(ratesArray[rateExtCck], 16) + | POW_SM(ratesArray[rateDupOfdm], 8) + | POW_SM(ratesArray[rateDupCck], 0) + ); + } +} + + +/************************************************************** * ar5416SetTransmitPower * * Set the transmit power in the baseband for the given @@ -804,7 +897,6 @@ HAL_BOOL ar5416SetTransmitPower(struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t *rfXpdGain) { -#define POW_SM(_r, _s) (((_r) & 0x3f) << (_s)) #define N(a) (sizeof (a) / sizeof (a[0])) MODAL_EEP_HEADER *pModal; @@ -943,78 +1035,27 @@ ar5416SetTransmitPower(struct ath_hal *a } } - /* Write the OFDM power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE1, - POW_SM(ratesArray[rate18mb], 24) - | POW_SM(ratesArray[rate12mb], 16) - | POW_SM(ratesArray[rate9mb], 8) - | POW_SM(ratesArray[rate6mb], 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE2, - POW_SM(ratesArray[rate54mb], 24) - | POW_SM(ratesArray[rate48mb], 16) - | POW_SM(ratesArray[rate36mb], 8) - | POW_SM(ratesArray[rate24mb], 0) - ); - - if (IEEE80211_IS_CHAN_2GHZ(chan)) { - /* Write the CCK power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE3, - POW_SM(ratesArray[rate2s], 24) - | POW_SM(ratesArray[rate2l], 16) - | POW_SM(ratesArray[rateXr], 8) /* XR target power */ - | POW_SM(ratesArray[rate1l], 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE4, - POW_SM(ratesArray[rate11s], 24) - | POW_SM(ratesArray[rate11l], 16) - | POW_SM(ratesArray[rate5_5s], 8) - | POW_SM(ratesArray[rate5_5l], 0) - ); - HALDEBUG(ah, HAL_DEBUG_RESET, - "%s AR_PHY_POWER_TX_RATE3=0x%x AR_PHY_POWER_TX_RATE4=0x%x\n", - __func__, OS_REG_READ(ah,AR_PHY_POWER_TX_RATE3), - OS_REG_READ(ah,AR_PHY_POWER_TX_RATE4)); - } - - /* Write the HT20 power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE5, - POW_SM(ratesArray[rateHt20_3], 24) - | POW_SM(ratesArray[rateHt20_2], 16) - | POW_SM(ratesArray[rateHt20_1], 8) - | POW_SM(ratesArray[rateHt20_0], 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE6, - POW_SM(ratesArray[rateHt20_7], 24) - | POW_SM(ratesArray[rateHt20_6], 16) - | POW_SM(ratesArray[rateHt20_5], 8) - | POW_SM(ratesArray[rateHt20_4], 0) - ); - + /* + * Adjust the HT40 power to meet the correct target TX power + * for 40MHz mode, based on TX power curves that are established + * for 20MHz mode. + * + * XXX handle overflow/too high power level? + */ if (IEEE80211_IS_CHAN_HT40(chan)) { - /* Write the HT40 power per rate set */ - /* Correct PAR difference between HT40 and HT20/LEGACY */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE7, - POW_SM(ratesArray[rateHt40_3] + ht40PowerIncForPdadc, 24) - | POW_SM(ratesArray[rateHt40_2] + ht40PowerIncForPdadc, 16) - | POW_SM(ratesArray[rateHt40_1] + ht40PowerIncForPdadc, 8) - | POW_SM(ratesArray[rateHt40_0] + ht40PowerIncForPdadc, 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE8, - POW_SM(ratesArray[rateHt40_7] + ht40PowerIncForPdadc, 24) - | POW_SM(ratesArray[rateHt40_6] + ht40PowerIncForPdadc, 16) - | POW_SM(ratesArray[rateHt40_5] + ht40PowerIncForPdadc, 8) - | POW_SM(ratesArray[rateHt40_4] + ht40PowerIncForPdadc, 0) - ); - /* Write the Dup/Ext 40 power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE9, - POW_SM(ratesArray[rateExtOfdm], 24) - | POW_SM(ratesArray[rateExtCck], 16) - | POW_SM(ratesArray[rateDupOfdm], 8) - | POW_SM(ratesArray[rateDupCck], 0) - ); + ratesArray[rateHt40_0] += ht40PowerIncForPdadc; + ratesArray[rateHt40_1] += ht40PowerIncForPdadc; + ratesArray[rateHt40_2] += ht40PowerIncForPdadc; + ratesArray[rateHt40_3] += ht40PowerIncForPdadc; + ratesArray[rateHt40_4] += ht40PowerIncForPdadc; + ratesArray[rateHt40_5] += ht40PowerIncForPdadc; + ratesArray[rateHt40_6] += ht40PowerIncForPdadc; + ratesArray[rateHt40_7] += ht40PowerIncForPdadc; } + /* Write the TX power rate registers */ + ar5416WriteTxPowerRateRegisters(ah, chan, ratesArray); + /* Write the Power subtraction for dynamic chain changing, for per-packet powertx */ OS_REG_WRITE(ah, AR_PHY_POWER_TX_SUB, POW_SM(pModal->pwrDecreaseFor3Chain, 6) From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 15:28:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5360106566C; Sun, 24 Apr 2011 15:28:53 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8EC4C8FC15; Sun, 24 Apr 2011 15:28:52 +0000 (UTC) Received: by bwz12 with SMTP id 12so1883540bwz.13 for ; Sun, 24 Apr 2011 08:28:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=3tfzIgQrd2esgkvDlGjboHE+sLMyHNXa+nYSEYccUhM=; b=aLGHIoBSpqes+fY71x31ruqw3QRMJ4/4fA2C+jKceoWw+OxgMvm3Dr6zVxvBbPCsJN LE7OkntXHVW6/LmiBD7pbejasZT79sHUKtQfIdNdBZx6E04Zhi+Fuc+YdxMbmYghc7o7 IbsFURF38iRVe6CqyWY42G7QXV3oWUE8MoSIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=EUz1tyoyBPylsA+9z2xy3JCyLz5PmLikbdM1n8r2CR5GDSosU4OTUv+D6+iK0BgIAF Jtbg/k5H9VrOCpKIcx4MDvR9RKAraQIIuDBTA0TPqExI38GJti8fxaES4uTNrgn3iqYx X85OBx0soEaQU1nERiqUb39aIqEuT1zG3CFV4= Received: by 10.204.154.219 with SMTP id p27mr2639631bkw.110.1303658931183; Sun, 24 Apr 2011 08:28:51 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id w3sm2792693bkt.5.2011.04.24.08.28.49 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 08:28:50 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB441B0.8020906@FreeBSD.org> Date: Sun, 24 Apr 2011 18:28:48 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Robert Watson References: <201104240858.p3O8wwqT024628@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Bjoern A. Zeeb" Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 15:28:53 -0000 Robert Watson wrote: > I'm very pleased to see a continued movement towards the new ATA code; > it offers clear benefits to all of our users, and is definitely > something we want done for 9.0. > > Could you say more about the migration strategy for users? I recall > that when you proposed throwing this switch, several strategies were > discussed (likely in combination to handle both the immediate upgrade > stumble issue and a longer-term migration): > > (1) Teach new ata parts to replicate the old naming convention in 99.9% of > cases. Or some suppport module that creates the required symlinks if > loaded (and we load it by default in 9.0, phasing it out later with > appropriate boot-time warnings for 6-12 months). Obviously, this > would be > best-effort, but if it takes us from a 40% upgrade failure to a 1% > upgrade > failure, that's a big deal. > > (2) Over time, provide a migration to fstab naming storage targets by > volume > ID / name / serial number, rather than by hardware path. A good > long-term > strategy but one that requires changes to the installer, upgrade path, > etc. > > (3) Teach freebsd-update/installer/etc to recognise *before* a new > kernel is > installed whether the current configuration will require hand-holding. > > (4) Thinking pretty hard about the roll-back path to avoid stumbles when > there's a problem following a kernel update. In the past, linking > kernel > feature updates to /etc or userspace updates has caused significant > issues > for our users, who reasonably expect to follow our normal "install the > kernel, reboot, let it sit for a week" path. > > What is your plan for implementing some combination of these (or did I > miss the commits that brought them in already)? In the past, we've seen > upgrade path problems dislodge users, and since then, we've grown an > increased assumption of ease-of-upgrade that can be managed > automatically by tools like freebsd-update. Breaking the automated > upgrade (and roll-back) path would be extremely problematic. I was hoping to not expand migration process onto another decade. Many users already migrated to the new infrastructure on both STABLE and CURRENT and AFAIK editing fstab was not a major problem for them. Since the last big discussion of this question about year ago we got graid implemented and some other things required to keep previous functionality, that could hold users from migration. Making this commit now I was prepared to spend few weeks on active bug fixing to minimize number of further rollback cases. So at this moment device names change is the last major problem I know. Yes, it was the same year ago, but there was same discussion as the last week about using labels in fstab, that equally ended with nothing. :( What's about creating some kind of symlinks, it could be nice if it worked, but I don't see the way to do it on disk(9) or GEOM layers without breaking device's access counters and as result further random problems. Looking now on these "do or revert" demands to keep old device naming, I'll try to make some hacks to CAM and ada(4) driver to mimic old "adX" names. I see it in form of some loader tunable, disabled by default (as it should be on newly installed systems), but that could be set prior to upgrade if user doesn't want to bother with device names at that moment. It should partially hide problem for some time. Will such solution be acceptable? -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 15:48:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2BAB106566C; Sun, 24 Apr 2011 15:48:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A17CA8FC08; Sun, 24 Apr 2011 15:48:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OFm7cw037599; Sun, 24 Apr 2011 15:48:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OFm7kr037597; Sun, 24 Apr 2011 15:48:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104241548.p3OFm7kr037597@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Apr 2011 15:48:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220989 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 15:48:08 -0000 Author: adrian Date: Sun Apr 24 15:48:07 2011 New Revision: 220989 URL: http://svn.freebsd.org/changeset/base/220989 Log: Use the refactored ar5416WriteTxPowerRateRegisters() call in the ar9285 code. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Apr 24 14:50:29 2011 (r220988) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Sun Apr 24 15:48:07 2011 (r220989) @@ -148,76 +148,27 @@ ar9285SetTransmitPower(struct ath_hal *a ar5416PrintPowerPerRate(ah, ratesArray); #endif - /* Write the OFDM power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE1, - POW_SM(ratesArray[rate18mb], 24) - | POW_SM(ratesArray[rate12mb], 16) - | POW_SM(ratesArray[rate9mb], 8) - | POW_SM(ratesArray[rate6mb], 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE2, - POW_SM(ratesArray[rate54mb], 24) - | POW_SM(ratesArray[rate48mb], 16) - | POW_SM(ratesArray[rate36mb], 8) - | POW_SM(ratesArray[rate24mb], 0) - ); - - /* Write the CCK power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE3, - POW_SM(ratesArray[rate2s], 24) - | POW_SM(ratesArray[rate2l], 16) - | POW_SM(ratesArray[rateXr], 8) /* XR target power */ - | POW_SM(ratesArray[rate1l], 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE4, - POW_SM(ratesArray[rate11s], 24) - | POW_SM(ratesArray[rate11l], 16) - | POW_SM(ratesArray[rate5_5s], 8) - | POW_SM(ratesArray[rate5_5l], 0) - ); - HALDEBUG(ah, HAL_DEBUG_RESET, - "%s AR_PHY_POWER_TX_RATE3=0x%x AR_PHY_POWER_TX_RATE4=0x%x\n", - __func__, OS_REG_READ(ah,AR_PHY_POWER_TX_RATE3), - OS_REG_READ(ah,AR_PHY_POWER_TX_RATE4)); - - /* Write the HT20 power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE5, - POW_SM(ratesArray[rateHt20_3], 24) - | POW_SM(ratesArray[rateHt20_2], 16) - | POW_SM(ratesArray[rateHt20_1], 8) - | POW_SM(ratesArray[rateHt20_0], 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE6, - POW_SM(ratesArray[rateHt20_7], 24) - | POW_SM(ratesArray[rateHt20_6], 16) - | POW_SM(ratesArray[rateHt20_5], 8) - | POW_SM(ratesArray[rateHt20_4], 0) - ); - + /* + * Adjust the HT40 power to meet the correct target TX power + * for 40MHz mode, based on TX power curves that are established + * for 20MHz mode. + * + * XXX handle overflow/too high power level? + */ if (IEEE80211_IS_CHAN_HT40(chan)) { - /* Write the HT40 power per rate set */ - /* Correct PAR difference between HT40 and HT20/LEGACY */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE7, - POW_SM(ratesArray[rateHt40_3] + ht40PowerIncForPdadc, 24) - | POW_SM(ratesArray[rateHt40_2] + ht40PowerIncForPdadc, 16) - | POW_SM(ratesArray[rateHt40_1] + ht40PowerIncForPdadc, 8) - | POW_SM(ratesArray[rateHt40_0] + ht40PowerIncForPdadc, 0) - ); - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE8, - POW_SM(ratesArray[rateHt40_7] + ht40PowerIncForPdadc, 24) - | POW_SM(ratesArray[rateHt40_6] + ht40PowerIncForPdadc, 16) - | POW_SM(ratesArray[rateHt40_5] + ht40PowerIncForPdadc, 8) - | POW_SM(ratesArray[rateHt40_4] + ht40PowerIncForPdadc, 0) - ); - /* Write the Dup/Ext 40 power per rate set */ - OS_REG_WRITE(ah, AR_PHY_POWER_TX_RATE9, - POW_SM(ratesArray[rateExtOfdm], 24) - | POW_SM(ratesArray[rateExtCck], 16) - | POW_SM(ratesArray[rateDupOfdm], 8) - | POW_SM(ratesArray[rateDupCck], 0) - ); + ratesArray[rateHt40_0] += ht40PowerIncForPdadc; + ratesArray[rateHt40_1] += ht40PowerIncForPdadc; + ratesArray[rateHt40_2] += ht40PowerIncForPdadc; + ratesArray[rateHt40_3] += ht40PowerIncForPdadc; + ratesArray[rateHt40_4] += ht40PowerIncForPdadc; + ratesArray[rateHt40_5] += ht40PowerIncForPdadc; + ratesArray[rateHt40_6] += ht40PowerIncForPdadc; + ratesArray[rateHt40_7] += ht40PowerIncForPdadc; } + /* Write the TX power rate registers */ + ar5416WriteTxPowerRateRegisters(ah, chan, ratesArray); + return AH_TRUE; #undef POW_SM #undef N From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 15:53:57 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3AAF106564A; Sun, 24 Apr 2011 15:53:57 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7B148FC19; Sun, 24 Apr 2011 15:53:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3OFrv4t037801; Sun, 24 Apr 2011 15:53:57 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3OFrvIi037797; Sun, 24 Apr 2011 15:53:57 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104241553.p3OFrvIi037797@svn.freebsd.org> From: Adrian Chadd Date: Sun, 24 Apr 2011 15:53:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220990 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 15:53:58 -0000 Author: adrian Date: Sun Apr 24 15:53:57 2011 New Revision: 220990 URL: http://svn.freebsd.org/changeset/base/220990 Log: Break out the PLL setup into an overridable method. The only method right now is ar5416InitPLL() which handles multiple chipsets; this can now be overridden by newer chipset HAL code. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 24 15:48:07 2011 (r220989) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sun Apr 24 15:53:57 2011 (r220990) @@ -103,6 +103,10 @@ struct ath_hal_5416 { const struct ieee80211_channel *chan, int16_t *pTxPowerIndexOffset); + /* baseband operations */ + void (*ah_initPLL) (struct ath_hal *ah, + const struct ieee80211_channel *chan); + u_int ah_globaltxtimeout; /* global tx timeout */ u_int ah_gpioMask; int ah_hangs; /* h/w hangs state */ @@ -248,6 +252,8 @@ extern void ar5416EepromSetAddac(struct const struct ieee80211_channel *chan); extern uint16_t ar5416GetMaxEdgePower(uint16_t freq, CAL_CTL_EDGES *pRdEdgesPower, HAL_BOOL is2GHz); +extern void ar5416InitPLL(struct ath_hal *ah, + const struct ieee80211_channel *chan); /* TX power setup related routines in ar5416_reset.c */ extern void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Apr 24 15:48:07 2011 (r220989) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sun Apr 24 15:53:57 2011 (r220990) @@ -181,6 +181,9 @@ ar5416InitState(struct ath_hal_5416 *ahp AH5416(ah)->ah_writeIni = ar5416WriteIni; AH5416(ah)->ah_spurMitigate = ar5416SpurMitigate; + /* Internal baseband ops */ + AH5416(ah)->ah_initPLL = ar5416InitPLL; + /* Internal calibration ops */ AH5416(ah)->ah_cal_initcal = ar5416InitCalHardware; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 24 15:48:07 2011 (r220989) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Apr 24 15:53:57 2011 (r220990) @@ -54,7 +54,6 @@ static void ar5416SetDeltaSlope(struct a static HAL_BOOL ar5416SetResetPowerOn(struct ath_hal *ah); static HAL_BOOL ar5416SetReset(struct ath_hal *ah, int type); -static void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan); static HAL_BOOL ar5416SetPowerPerRateTable(struct ath_hal *ah, struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan, int16_t *ratesArray, @@ -513,7 +512,7 @@ ar5416InitBB(struct ath_hal *ah, const s /* Turn on PLL on 5416 */ HALDEBUG(ah, HAL_DEBUG_RESET, "%s %s channel\n", __func__, IEEE80211_IS_CHAN_5GHZ(chan) ? "5GHz" : "2GHz"); - ar5416InitPLL(ah, chan); + AH5416(ah)->ah_initPLL(ah, chan); /* Activate the PHY (includes baseband activate and synthesizer on) */ OS_REG_WRITE(ah, AR_PHY_ACTIVE, AR_PHY_ACTIVE_EN); @@ -655,7 +654,7 @@ ar5416ChipReset(struct ath_hal *ah, cons if (!ar5416SetPowerMode(ah, HAL_PM_AWAKE, AH_TRUE)) return AH_FALSE; - ar5416InitPLL(ah, chan); + AH5416(ah)->ah_initPLL(ah, chan); /* * Perform warm reset before the mode/PLL/turbo registers @@ -1221,7 +1220,7 @@ ar5416SetReset(struct ath_hal *ah, int t OS_REG_WRITE(ah, AR_CFG, INIT_CONFIG_STATUS); } - ar5416InitPLL(ah, AH_NULL); + AH5416(ah)->ah_initPLL(ah, AH_NULL); return AH_TRUE; } @@ -1278,7 +1277,7 @@ ar5416UpdateChainMasks(struct ath_hal *a #define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE #endif -static void +void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) { uint32_t pll; From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 16:32:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id D46CA1065675; Sun, 24 Apr 2011 16:32:58 +0000 (UTC) Date: Sun, 24 Apr 2011 16:32:58 +0000 From: Alexey Dokuchaev To: Alexander Motin Message-ID: <20110424163258.GA32595@FreeBSD.org> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <4DB441B0.8020906@FreeBSD.org> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 16:32:58 -0000 On Sun, Apr 24, 2011 at 06:28:48PM +0300, Alexander Motin wrote: > What's about creating some kind of symlinks, it could be nice if it > worked, but I don't see the way to do it on disk(9) or GEOM layers > without breaking device's access counters and as result further random > problems. Speaking on Alexander's side, I'd want to mention that many of our users had been bitten by obscure adX naming during past years (largely due to ATA_STATIC_ID option which was probably useful back in times when there typically was only one IDE controller present in system, but leads to all sorts of weird ad4-6-8's in recent years) had already migrated to glabel or GPT labels, to avoid precisely the issues we're talking about here. ./danfe From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 16:34:48 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 058EC106566B; Sun, 24 Apr 2011 16:34:48 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 7753F8FC15; Sun, 24 Apr 2011 16:34:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.4/8.14.4) with ESMTP id p3OGJZ1a018933; Sun, 24 Apr 2011 20:19:35 +0400 (MSD) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.4/8.14.4/Submit) id p3OGJYxp018932; Sun, 24 Apr 2011 20:19:34 +0400 (MSD) (envelope-from ache) Date: Sun, 24 Apr 2011 20:19:33 +0400 From: Andrey Chernov To: Alexander Motin Message-ID: <20110424161933.GA18775@vniz.net> Mail-Followup-To: Andrey Chernov , Alexander Motin , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201104240923.p3O9N8QG025386@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104240923.p3O9N8QG025386@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 16:34:48 -0000 On Sun, Apr 24, 2011 at 09:23:08AM +0000, Alexander Motin wrote: > ATA device names in /etc/fstab or other places, make sure to update > them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, > - where 'Y's are the sequential numbers for each type in order of > - detection, unless configured otherwise with tunables, see cam(4)). > + where 'Y's are the sequential numbers starting from zero for each type > + in order of detection, unless configured otherwise with tunables, > + see cam(4)). Is there any way to guess resulting 'Y' numbers _before_ booting new kernel? I have remote machine with console access almost impossible (very hard for me). It seems something like vfs.root.mountfrom="ufs:/dev/ada0s1a ufs:/dev/ada1s1a ..." (up to max channels) helps to find root, but what about other mounted disks? -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 16:38:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D120106570E; Sun, 24 Apr 2011 16:38:12 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5244D8FC14; Sun, 24 Apr 2011 16:38:10 +0000 (UTC) Received: by bwz12 with SMTP id 12so1912701bwz.13 for ; Sun, 24 Apr 2011 09:38:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=mQ9jtXZaWNdfFS3GnvVUOqcrM8JMxsoRNWgLSuNNJQ4=; b=EtxMusBv3DdupbHcT3lpAbBMmhSDv/1tyDyUA5tlPhpPF2opNd0ZCc73ANb2vVVpy1 9RFRcX3HMYwF5qN8hguzq9rTM9u/mcSgddiZ3FyKgcXAJ6AXEClTevbXETyMPgQyRnpa sg6nU19du34bEv0wFulTBRvFC9ens1qSACl2I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=eXIrC/clZRq7XZvhmyXFdbCfX8T/wekHduHrD+Rge54F/y7EEqQOmmscsiyr4bbh4F wt+CUqI76emE1Q3bTwrQ6LRuvHY/vVtKfQyqRN7uM4jP5U6pOaWqQZBSymr/qB2/sdRT eO1R5QUTU933q/8Fc3oIZYKdONXi8izAZPqHs= Received: by 10.204.74.218 with SMTP id v26mr665216bkj.76.1303663089903; Sun, 24 Apr 2011 09:38:09 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id u15sm215732bkf.4.2011.04.24.09.38.08 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 09:38:09 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB451EF.8090301@FreeBSD.org> Date: Sun, 24 Apr 2011 19:38:07 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Andrey Chernov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424161933.GA18775@vniz.net> In-Reply-To: <20110424161933.GA18775@vniz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 16:38:12 -0000 On 24.04.2011 19:19, Andrey Chernov wrote: > On Sun, Apr 24, 2011 at 09:23:08AM +0000, Alexander Motin wrote: >> ATA device names in /etc/fstab or other places, make sure to update >> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, >> - where 'Y's are the sequential numbers for each type in order of >> - detection, unless configured otherwise with tunables, see cam(4)). >> + where 'Y's are the sequential numbers starting from zero for each type >> + in order of detection, unless configured otherwise with tunables, >> + see cam(4)). > > Is there any way to guess resulting 'Y' numbers _before_ booting new > kernel? I have remote machine with console access almost impossible (very > hard for me). In most cases order of adaX devices should match order of ad devices, so first adX will become ada0, second - ada1, etc. The only exception there should be devices on ATA channels in legacy/ISA emulation mode: ata0 (ad0/ad1) and ata1 (ad2/ad3). Old ATA always allocated these devices first, but new ATA will allocate them as any other in order of their channels registration. That order you can see in dmesg. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 16:54:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F41E106566C; Sun, 24 Apr 2011 16:54:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 441DB8FC08; Sun, 24 Apr 2011 16:54:49 +0000 (UTC) Received: from [192.168.2.112] (host86-147-11-178.range86-147.btcentralplus.com [86.147.11.178]) by cyrus.watson.org (Postfix) with ESMTPSA id E975046B49; Sun, 24 Apr 2011 12:54:47 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <20110424163258.GA32595@FreeBSD.org> Date: Sun, 24 Apr 2011 17:54:46 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <69D8AAE8-253B-4BD1-83E3-F300FCF3316C@FreeBSD.org> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110424163258.GA32595@FreeBSD.org> To: Alexey Dokuchaev X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, "Bjoern A. Zeeb" , svn-src-all@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 16:54:49 -0000 On 24 Apr 2011, at 17:32, Alexey Dokuchaev wrote: > On Sun, Apr 24, 2011 at 06:28:48PM +0300, Alexander Motin wrote: >> What's about creating some kind of symlinks, it could be nice if it >> worked, but I don't see the way to do it on disk(9) or GEOM layers >> without breaking device's access counters and as result further = random >> problems. >=20 > Speaking on Alexander's side, I'd want to mention that many of our = users > had been bitten by obscure adX naming during past years (largely due = to > ATA_STATIC_ID option which was probably useful back in times when = there > typically was only one IDE controller present in system, but leads to = all > sorts of weird ad4-6-8's in recent years) had already migrated to = glabel > or GPT labels, to avoid precisely the issues we're talking about here. Yes, the argument is not over whether the change should be made, but how = we can get it done in time for 9.0-RELEASE in such a way that it = minimises disruption for our users. Clearly, we need the new AHCI driver = as the default in the release. But if we make upgrading (and rolling = back) significantly harder, that hurts us a lot. Ideally, we would have = shipped the migration parts in 8.2 so that 9.0 was a driver change = event, not a device naming model change event (easing in the = administrative hurdle). Robert= From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 16:57:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 071A6106564A; Sun, 24 Apr 2011 16:57:06 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id CFE8B8FC0C; Sun, 24 Apr 2011 16:57:05 +0000 (UTC) Received: from [192.168.2.112] (host86-147-11-178.range86-147.btcentralplus.com [86.147.11.178]) by cyrus.watson.org (Postfix) with ESMTPSA id 805DD46B38; Sun, 24 Apr 2011 12:57:04 -0400 (EDT) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: <4DB40E39.5090905@FreeBSD.org> Date: Sun, 24 Apr 2011 17:57:03 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <77FE817D-D548-4B79-A64B-C890D94323B9@FreeBSD.org> <4DB40026.5030405@FreeBSD.org> <4DB40E39.5090905@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 16:57:06 -0000 On 24 Apr 2011, at 12:49, Alexander Motin wrote: >>> Reverting is not an option. _Constructive_ propositions are welcome. >>=20 >> It is the policy of this project that the release engineering team = has >> final authority over what ships in a release. It is entirely within >> scope to revert this change for 9.0 if issues with the upgrade path = are >> not addressed. My hope also that this path can be entirely avoided >> through a rapid addressing of upgrade path issues that have been = known >> (and discussed on the mailing lists extensively) since you posted = about >> the work on the public mailing lists. >>=20 >> I agree with Bjoern that it is critical to address these issues in a >> timely manner -- our users depend on reliable and easy upgrades, and = it >> seems (on face value) that significant work remains to be done to = make >> that possible. Our release is increasingly close, and it's important = we >> keep the tree as stable as possible so that merges of other = straggling >> features can go uneventfully. >=20 > I am asking for excuse if my tone was overly strict. It was not my = real intention to offend anybody. May be inside I am indeed overreacting = a bit on proposition to revert with no alternative things that I have = put my heart into, which are broadly accepted by users, which I = announced on the list few days ago and got no objections. I am sorry for = that. >=20 > I do worry about possible complications during migration process. And = obviously this is not an easy question, as soon as it wasn't solved = during so much time. I will gladly accept any help or real ideas people = can provide. I just don't like to feel it my own problem. I am not doing = it for myself. It would be nice to see some friendly support instead. Let's be clear: Bjoern didn't say you should revert it immediately. He = said that the migration path needs to be fixed in the next month (2-4 = weeks). That leaves plenty of time to resolve these issues, which I = think the consensus is should have been resolved before committing the = switch, not after. But given that it's in the tree, let's leave it there = for now to continue to improve our testing exposure, and try to get it = fixed as quickly as possible. Robert= From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 17:34:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96B67106566B; Sun, 24 Apr 2011 17:34:22 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 4627D8FC0A; Sun, 24 Apr 2011 17:34:20 +0000 (UTC) Received: from [192.168.1.9] (cm-84.215.40.84.getinternet.no [84.215.40.84]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3OHY6eN019475 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 25 Apr 2011 03:04:09 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: <20110424161933.GA18775@vniz.net> Date: Sun, 24 Apr 2011 19:34:05 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au> References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424161933.GA18775@vniz.net> To: Andrey Chernov X-Mailer: Apple Mail (2.1084) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 17:34:22 -0000 On 24/04/2011, at 18:19, Andrey Chernov wrote: > On Sun, Apr 24, 2011 at 09:23:08AM +0000, Alexander Motin wrote: >> ATA device names in /etc/fstab or other places, make sure to = update >> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX = -> saY, >> - where 'Y's are the sequential numbers for each type in order of >> - detection, unless configured otherwise with tunables, see = cam(4)). >> + where 'Y's are the sequential numbers starting from zero for = each type >> + in order of detection, unless configured otherwise with = tunables, >> + see cam(4)). >=20 > Is there any way to guess resulting 'Y' numbers _before_ booting new=20= > kernel? I have remote machine with console access almost impossible = (very=20 > hard for me). >=20 > It seems something like > vfs.root.mountfrom=3D"ufs:/dev/ada0s1a ufs:/dev/ada1s1a ..." > (up to max channels) helps to find root, but what about other mounted=20= > disks? The best way is to change to use GPT IDs (/dev/gptid/xxx) if you are on = a GPT system) or UFS IDs (/dev/ufsid/xxx) if you can't. gpart list will show the GPTID (rawuuid) and dumpfs will show the UFS = ID. The following shell snippet will generate the UFS ID for a given FS. getfsid() { line=3D`dumpfs 2> /dev/null $1 | head | grep superblock\ location` if [ $? -ne 0 ]; then return 1 fi # dumpfs doesn't print leading 0s eval `echo $line | sed -nEe 's/superblock location.*id.*\[ (.*) (.*)\ = ]/printf %0x $((0x\1 << 32 | 0x\2))/p'` } -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 18:59:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6956E106564A; Sun, 24 Apr 2011 18:59:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id E1F638FC14; Sun, 24 Apr 2011 18:59:44 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A1B4825D3857; Sun, 24 Apr 2011 18:59:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 04772159DB43; Sun, 24 Apr 2011 18:59:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id joRQkvUrB5sn; Sun, 24 Apr 2011 18:59:41 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4ACA0159DB42; Sun, 24 Apr 2011 18:59:41 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <4DB441B0.8020906@FreeBSD.org> Date: Sun, 24 Apr 2011 18:59:40 +0000 Content-Transfer-Encoding: 7bit Message-Id: References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 18:59:45 -0000 On Apr 24, 2011, at 3:28 PM, Alexander Motin wrote: > I was hoping to not expand migration process onto another decade. Many > users already migrated to the new infrastructure on both STABLE and > CURRENT and AFAIK editing fstab was not a major problem for them. Do not think that based on the hundred replies on the lists in two years, that any of the hundreds of thousands of machines you haven't heard of were migrated. A LOT of people simply run on defaults we provide. > ... So at this moment device names change > is the last major problem I know. Yes, it was the same year ago, but > there was same discussion as the last week about using labels in fstab, > that equally ended with nothing. :( I am sorry if I was too direct with the "fix it the next weeks or backout" earlier today. As I had said on current@ I have migrated machines myself and am testing things where possible and it's a good thing to move to. As I had also said on current@ "we must not screw our users and need transition magic". I think a couple of others just didn't repeat what was said months ago. > What's about creating some kind of symlinks, it could be nice if it > worked, but I don't see the way to do it on disk(9) or GEOM layers > without breaking device's access counters and as result further random > problems. I had been pondering devfs "link"s myself, the problem is that from the rc framework they come too late. If you can add a simple .ko that does it programmatically on 9 that would be great. The problem is that after booting the new kernel you don't know whether people had ATA_STATIC on or not, so we'd have to go with the defaults, that were in 8.x (and an extra tunable to flip the logic maybe)? > Looking now on these "do or revert" demands to keep old device naming, > I'll try to make some hacks to CAM and ada(4) driver to mimic old "adX" > names. I see it in form of some loader tunable, disabled by default (as > it should be on newly installed systems), but that could be set prior to > upgrade if user doesn't want to bother with device names at that moment. > It should partially hide problem for some time. It would need to be in and on by default for the lifetime of 9 as it's not in the last 8.x release (which would need it the other way round anyway. MIght it be a good idea to do that as well afterwards providing ada links on the next 8.x release?). The user could disable it after the conversion happened though with a tunable to get rid of the extra /dev/* noise. We could even check for it being on and check fstab and warn/pester the user then that he'll need to migrate (on boot from rc.d, in weekly mails, ...). If we have both information available (old from the kernel transition code) and new we could even provide a script to do it. The reason we might not want to do it automatically is that if the user will decide to boot kernel.old because the new kernel panics after 2 days, she'll be facing the new ada entries in fstab with an 8.x kernel and that would not work either. So it's a decision users need to make eventually themselves during the lifetime of 9.x when upgrading from an older release. > Will such solution be acceptable? I think any solution will be acceptable if it (mostly) works and gets the possible fallout rate (significantly) down and thanks a lot for picking it up now! Bjoern PS: And I think you'll find a lot of testers the next days/weeks on current@ when people update their kernels and forgot to read UPDATING or fail to do the conversion properly.;) -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family. From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 19:41:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3C651065672; Sun, 24 Apr 2011 19:41:13 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 582BC8FC16; Sun, 24 Apr 2011 19:41:11 +0000 (UTC) Received: by bwz12 with SMTP id 12so1982518bwz.13 for ; Sun, 24 Apr 2011 12:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=yNSOmaQ55AGmGK/96cULsZRPgQJvgfptmP/pBV7oJx0=; b=Ak7GrmSYVfhHYMnT4l0V0j7llD3MWZBTQ0pHntK7Er66RlWUGcs3YdSt3KQzZzGTHy tZ6N1j8ew0/74/mlAW0b2S6q7ubXB7p59CVbdIb/nIUvjQ79Ymw8T+HqAv8oXUoovO16 rwbFoX0Xz5+rYT7axmjiSl+VY2QNm5YopKfy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=XhU8bqLSXhJ97lCRTx74eEwlhZDv/3Cbh2mZ0S+BlQeZzACqBcPzytegQSrxBs2s0n ewiclW7V4K2Kpt4/Donrx9snzrO1B1KavIrzvTvCDupEsxxB/4rpIZwT8khqUfFzKU9B I/51Gt9E/kMUID837OsTInlEwmOTbpf74LYkU= Received: by 10.204.19.5 with SMTP id y5mr2839200bka.194.1303674070981; Sun, 24 Apr 2011 12:41:10 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l1sm2893508bkl.1.2011.04.24.12.41.09 (version=SSLv3 cipher=OTHER); Sun, 24 Apr 2011 12:41:10 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB47CD4.9060300@FreeBSD.org> Date: Sun, 24 Apr 2011 22:41:08 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Robert Watson Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 19:41:13 -0000 On 24.04.2011 21:59, Bjoern A. Zeeb wrote: >> What's about creating some kind of symlinks, it could be nice if it >> worked, but I don't see the way to do it on disk(9) or GEOM layers >> without breaking device's access counters and as result further random >> problems. > > I had been pondering devfs "link"s myself, the problem is that from the rc > framework they come too late. If you can add a simple .ko that does it > programmatically on 9 that would be great. The problem is that after booting > the new kernel you don't know whether people had ATA_STATIC on or not, so > we'd have to go with the defaults, that were in 8.x (and an extra tunable to > flip the logic maybe)? Devfs links won't help users with hardcoded provider names in gmirror, etc -- from GEOM PoV there will be no such providers. Also to create proper mapping that module should have real-time information from CAM about ATA controller details. And looking that it will have to link in real time any derivative providers also (ad4s1a -> ada0s1a) I worry if it is possible at all. Some devfs expert needed here. >> Looking now on these "do or revert" demands to keep old device naming, >> I'll try to make some hacks to CAM and ada(4) driver to mimic old "adX" >> names. I see it in form of some loader tunable, disabled by default (as >> it should be on newly installed systems), but that could be set prior to >> upgrade if user doesn't want to bother with device names at that moment. >> It should partially hide problem for some time. > > It would need to be in and on by default for the lifetime of 9 as it's not > in the last 8.x release (which would need it the other way round anyway. > MIght it be a good idea to do that as well afterwards providing ada links > on the next 8.x release?). I wouldn't like to keep that ugly numbering on by default till the 9.x EoL even for new installations. Also remember about number of people already using new ATA, for whom requirement to disable that tunable may also be uncomfortable. > The user could disable it after the conversion happened though with a tunable > to get rid of the extra /dev/* noise. We could even check for it being on > and check fstab and warn/pester the user then that he'll need to migrate > (on boot from rc.d, in weekly mails, ...). It would be fine if it was just devfs noise, but I have some doubts about it (above). > If we have both information available (old from the kernel transition code) > and new we could even provide a script to do it. > > The reason we might not want to do it automatically is that if the user will > decide to boot kernel.old because the new kernel panics after 2 days, she'll > be facing the new ada entries in fstab with an 8.x kernel and that would not > work either. So it's a decision users need to make eventually themselves > during the lifetime of 9.x when upgrading from an older release. Reasonable. >> Will such solution be acceptable? > > I think any solution will be acceptable if it (mostly) works and gets the > possible fallout rate (significantly) down and thanks a lot for picking it > up now! But that solution should not include setting tunables before upgrading? Can't we teach mergemaster or whatever else to set it depending on whet disks are now present in system? > PS: And I think you'll find a lot of testers the next days/weeks on current@ > when people update their kernels and forgot to read UPDATING or fail to > do the conversion properly.;) I can always say: "read UPDATING" (for log: I am not completely serious here. :)). -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Sun Apr 24 22:18:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BCEC1065672; Sun, 24 Apr 2011 22:18:41 +0000 (UTC) (envelope-from mack@macktronics.com) Received: from coco.macktronics.com (coco.macktronics.com [209.181.253.65]) by mx1.freebsd.org (Postfix) with ESMTP id 64E278FC14; Sun, 24 Apr 2011 22:18:41 +0000 (UTC) Received: from coco.macktronics.com (coco.macktronics.com [209.181.253.65]) by coco.macktronics.com (Postfix) with ESMTP id 964164AC40; Sun, 24 Apr 2011 17:18:40 -0500 (CDT) Date: Sun, 24 Apr 2011 17:18:40 -0500 (CDT) From: Dan Mack To: Pawel Jakub Dawidek In-Reply-To: <20110424131804.GB1872@garage.freebsd.pl> Message-ID: <20110424171704.L2449@coco.macktronics.com> References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424095736.GA92492@freebsd.org> <20110424051747.S1757@coco.macktronics.com> <20110424131804.GB1872@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Alexander Best , Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2011 22:18:41 -0000 On Sun, 24 Apr 2011, Pawel Jakub Dawidek wrote: > On Sun, Apr 24, 2011 at 05:25:00AM -0500, Dan Mack wrote: >> For those of us using a ZFS root pool built out of /dev/gpt/ >> devices, will these automagically pick up the new names? > > Even if you use adX devices in your ZFS pool and they will suddenly > change to adaY, ZFS should detect this properly and no manual > intervention should be needed. Yep, confirmed. My boot zroot RAID10 pool previously built from ad4, ad6, ad8, ad10 worked without a hitch with the new enumeration scheme: borg# gpart status Name Status Components ada0p1 OK ada0 ada0p2 OK ada0 ada0p3 OK ada0 ada1p1 OK ada1 ada1p2 OK ada1 ada1p3 OK ada1 ada2p1 OK ada2 ada2p2 OK ada2 ada2p3 OK ada2 ada3p1 OK ada3 ada3p2 OK ada3 ada3p3 OK ada3 borg# zpool status pool: zroot state: ONLINE scan: none requested config: NAME STATE READ WRITE CKSUM zroot ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 gpt/disk0 ONLINE 0 0 0 gpt/disk1 ONLINE 0 0 0 mirror-1 ONLINE 0 0 0 gpt/disk2 ONLINE 0 0 0 gpt/disk3 ONLINE 0 0 0 From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 04:55:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B875106564A; Mon, 25 Apr 2011 04:55:51 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38BA38FC12; Mon, 25 Apr 2011 04:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3P4tp8J061350; Mon, 25 Apr 2011 04:55:51 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3P4tp4f061348; Mon, 25 Apr 2011 04:55:51 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201104250455.p3P4tp4f061348@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 25 Apr 2011 04:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221005 - head/sys/dev/msk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 04:55:51 -0000 Author: glebius Date: Mon Apr 25 04:55:50 2011 New Revision: 221005 URL: http://svn.freebsd.org/changeset/base/221005 Log: When msk_detach() is called from msk_attach(), ifp may be yet not initialized. Modified: head/sys/dev/msk/if_msk.c Modified: head/sys/dev/msk/if_msk.c ============================================================================== --- head/sys/dev/msk/if_msk.c Mon Apr 25 04:33:42 2011 (r221004) +++ head/sys/dev/msk/if_msk.c Mon Apr 25 04:55:50 2011 (r221005) @@ -1964,7 +1964,8 @@ msk_detach(device_t dev) /* Can't hold locks while calling detach. */ MSK_IF_UNLOCK(sc_if); callout_drain(&sc_if->msk_tick_ch); - ether_ifdetach(ifp); + if (ifp) + ether_ifdetach(ifp); MSK_IF_LOCK(sc_if); } From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 05:00:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65BBD1065670; Mon, 25 Apr 2011 05:00:55 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 0191A8FC0C; Mon, 25 Apr 2011 05:00:54 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3P4tfRe015983 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 24 Apr 2011 22:55:45 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au> Date: Sun, 24 Apr 2011 22:55:41 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424161933.GA18775@vniz.net> <18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au> To: "Daniel O'Connor" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 24 Apr 2011 22:55:45 -0600 (MDT) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 05:00:55 -0000 On Apr 24, 2011, at 11:34 AM, Daniel O'Connor wrote: >=20 > On 24/04/2011, at 18:19, Andrey Chernov wrote: >> On Sun, Apr 24, 2011 at 09:23:08AM +0000, Alexander Motin wrote: >>> ATA device names in /etc/fstab or other places, make sure to = update >>> them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX = -> saY, >>> - where 'Y's are the sequential numbers for each type in order of >>> - detection, unless configured otherwise with tunables, see = cam(4)). >>> + where 'Y's are the sequential numbers starting from zero for = each type >>> + in order of detection, unless configured otherwise with = tunables, >>> + see cam(4)). >>=20 >> Is there any way to guess resulting 'Y' numbers _before_ booting new=20= >> kernel? I have remote machine with console access almost impossible = (very=20 >> hard for me). >>=20 >> It seems something like >> vfs.root.mountfrom=3D"ufs:/dev/ada0s1a ufs:/dev/ada1s1a ..." >> (up to max channels) helps to find root, but what about other mounted=20= >> disks? >=20 > The best way is to change to use GPT IDs (/dev/gptid/xxx) if you are = on a GPT system) or UFS IDs (/dev/ufsid/xxx) if you can't. I've been running with ufs labels for a couple of years now, since the = first rumblings of this hit the streets. They work great no matter what = the underlying partitioning scheme. The one drawback is that if you = have multiple disks with the same labels, then the first one wins. = Normally not a problem, but when you have it, you need to ensure the = right one is selected. I avoid this problem by prefixing a hostname to = the label... > gpart list will show the GPTID (rawuuid) and dumpfs will show the UFS = ID. >=20 > The following shell snippet will generate the UFS ID for a given FS. >=20 > getfsid() { > line=3D`dumpfs 2> /dev/null $1 | head | grep superblock\ location` > if [ $? -ne 0 ]; then > return 1 > fi > # dumpfs doesn't print leading 0s > eval `echo $line | sed -nEe 's/superblock location.*id.*\[ (.*) (.*)\ = ]/printf %0x $((0x\1 << 32 | 0x\2))/p'` > } This is also good. Warner= From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 05:01:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A536A1065783; Mon, 25 Apr 2011 05:01:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3286E8FC08; Mon, 25 Apr 2011 05:01:06 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3P4xEGC015990 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sun, 24 Apr 2011 22:59:15 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <4DB47CD4.9060300@FreeBSD.org> Date: Sun, 24 Apr 2011 22:59:14 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <54259D19-F41D-460A-9016-5189947A6887@bsdimp.com> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <4DB47CD4.9060300@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sun, 24 Apr 2011 22:59:15 -0600 (MDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 05:01:12 -0000 Now that the horse is out of the barn, the following might be a little = late (unless we unpull the trigger for a month). But what if we warned that / was on a device name, and not on a 'named' = device. Complain if it was on /dev/da0, but not if it was on = /dev/ufs/fred-root. Users would see this warning and react. Next best thing: make installkernel check for devices on /dev/adX and = refuse to install the kernel if they are (unless REALLY_THIS_IS_RIGHT is = defined :). This won't help the binary upgrader, but will prevent massive = footshooting in the mean time. Warner On Apr 24, 2011, at 1:41 PM, Alexander Motin wrote: > On 24.04.2011 21:59, Bjoern A. Zeeb wrote: >>> What's about creating some kind of symlinks, it could be nice if it >>> worked, but I don't see the way to do it on disk(9) or GEOM layers >>> without breaking device's access counters and as result further = random >>> problems. >>=20 >> I had been pondering devfs "link"s myself, the problem is that from = the rc >> framework they come too late. If you can add a simple .ko that does = it >> programmatically on 9 that would be great. The problem is that after = booting >> the new kernel you don't know whether people had ATA_STATIC on or = not, so >> we'd have to go with the defaults, that were in 8.x (and an extra = tunable to >> flip the logic maybe)? >=20 > Devfs links won't help users with hardcoded provider names in gmirror, = etc -- from GEOM PoV there will be no such providers. Also to create = proper mapping that module should have real-time information from CAM = about ATA controller details. And looking that it will have to link in = real time any derivative providers also (ad4s1a -> ada0s1a) I worry if = it is possible at all. Some devfs expert needed here. >=20 >>> Looking now on these "do or revert" demands to keep old device = naming, >>> I'll try to make some hacks to CAM and ada(4) driver to mimic old = "adX" >>> names. I see it in form of some loader tunable, disabled by default = (as >>> it should be on newly installed systems), but that could be set = prior to >>> upgrade if user doesn't want to bother with device names at that = moment. >>> It should partially hide problem for some time. >>=20 >> It would need to be in and on by default for the lifetime of 9 as = it's not >> in the last 8.x release (which would need it the other way round = anyway. >> MIght it be a good idea to do that as well afterwards providing ada = links >> on the next 8.x release?). >=20 > I wouldn't like to keep that ugly numbering on by default till the 9.x = EoL even for new installations. Also remember about number of people = already using new ATA, for whom requirement to disable that tunable may = also be uncomfortable. >=20 >> The user could disable it after the conversion happened though with a = tunable >> to get rid of the extra /dev/* noise. We could even check for it = being on >> and check fstab and warn/pester the user then that he'll need to = migrate >> (on boot from rc.d, in weekly mails, ...). >=20 > It would be fine if it was just devfs noise, but I have some doubts = about it (above). >=20 >> If we have both information available (old from the kernel transition = code) >> and new we could even provide a script to do it. >>=20 >> The reason we might not want to do it automatically is that if the = user will >> decide to boot kernel.old because the new kernel panics after 2 days, = she'll >> be facing the new ada entries in fstab with an 8.x kernel and that = would not >> work either. So it's a decision users need to make eventually = themselves >> during the lifetime of 9.x when upgrading from an older release. >=20 > Reasonable. >=20 >>> Will such solution be acceptable? >>=20 >> I think any solution will be acceptable if it (mostly) works and gets = the >> possible fallout rate (significantly) down and thanks a lot for = picking it >> up now! >=20 > But that solution should not include setting tunables before = upgrading? Can't we teach mergemaster or whatever else to set it = depending on whet disks are now present in system? >=20 >> PS: And I think you'll find a lot of testers the next days/weeks on = current@ >> when people update their kernels and forgot to read UPDATING or fail = to >> do the conversion properly.;) >=20 > I can always say: "read UPDATING" (for log: I am not completely = serious here. :)). >=20 > --=20 > Alexander Motin >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 05:57:02 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 142E71065675; Mon, 25 Apr 2011 05:57:02 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCB058FC14; Mon, 25 Apr 2011 05:57:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3P5v1SN063137; Mon, 25 Apr 2011 05:57:01 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3P5v1xP063136; Mon, 25 Apr 2011 05:57:01 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201104250557.p3P5v1xP063136@svn.freebsd.org> From: Doug Barton Date: Mon, 25 Apr 2011 05:57:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221006 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 05:57:02 -0000 Author: dougb Date: Mon Apr 25 05:57:01 2011 New Revision: 221006 URL: http://svn.freebsd.org/changeset/base/221006 Log: Add svn:executable property Modified: Directory Properties: head/etc/rc.d/opensm (props changed) From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 06:03:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FEFD106566B; Mon, 25 Apr 2011 06:03:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E4D68FC15; Mon, 25 Apr 2011 06:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3P63MoW063370; Mon, 25 Apr 2011 06:03:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3P63MUe063368; Mon, 25 Apr 2011 06:03:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201104250603.p3P63MUe063368@svn.freebsd.org> From: Doug Barton Date: Mon, 25 Apr 2011 06:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221007 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 06:03:22 -0000 Author: dougb Date: Mon Apr 25 06:03:22 2011 New Revision: 221007 URL: http://svn.freebsd.org/changeset/base/221007 Log: Create a function for the code from r192246 so that it can be used both times mount is called. Limit the automatic behavior to when AUTO is specified (as it is in etc/defaults/rc.conf) and for everything else take advantage of all of the goodness in checkyesno. Modified: head/etc/rc.d/tmp Modified: head/etc/rc.d/tmp ============================================================================== --- head/etc/rc.d/tmp Mon Apr 25 05:57:01 2011 (r221006) +++ head/etc/rc.d/tmp Mon Apr 25 06:03:22 2011 (r221007) @@ -37,20 +37,20 @@ stop_cmd=':' load_rc_config $name +mount_tmpmfs () +{ + if ! /bin/df /tmp | grep -q "^/dev/md[0-9]"; then + mount_md ${tmpsize} /tmp "${tmpmfs_flags}" + chmod 01777 /tmp + fi +} + # If we do not have a writable /tmp, create a memory # filesystem for /tmp. If /tmp is a symlink (e.g. to /var/tmp, # then it should already be writable). # case "${tmpmfs}" in -[Yy][Ee][Ss]) - if ! /bin/df /tmp | grep -q "^/dev/md[0-9]"; then - mount_md ${tmpsize} /tmp "${tmpmfs_flags}" - chmod 01777 /tmp - fi - ;; -[Nn][Oo]) - ;; -*) +[Aa][Uu][Tt][Oo]) if _tmpdir=$(mktemp -d -q /tmp/.diskless.XXXXXX); then rmdir ${_tmpdir} else @@ -59,9 +59,13 @@ case "${tmpmfs}" in echo "dropping into shell, ^D to continue anyway." /bin/sh else - mount_md ${tmpsize} /tmp "${tmpmfs_flags}" - chmod 01777 /tmp + mount_tmpmfs fi fi ;; +*) + if checkyesno tmpmfs; then + mount_tmpmfs + fi + ;; esac From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 06:53:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F630106564A; Mon, 25 Apr 2011 06:53:16 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (unknown [IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16]) by mx1.freebsd.org (Postfix) with ESMTP id 764998FC16; Mon, 25 Apr 2011 06:53:15 +0000 (UTC) Received: from [192.168.1.9] (cm-84.215.40.84.getinternet.no [84.215.40.84]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3P6qrpw092254 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 25 Apr 2011 16:22:55 +0930 (CST) (envelope-from doconnor@gsoft.com.au) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Daniel O'Connor" In-Reply-To: Date: Mon, 25 Apr 2011 08:52:51 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au> References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424161933.GA18775@vniz.net> <18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au> To: Warner Losh X-Mailer: Apple Mail (2.1084) X-Spam-Score: 0.163 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 06:53:16 -0000 On 25/04/2011, at 6:55, Warner Losh wrote: >> The best way is to change to use GPT IDs (/dev/gptid/xxx) if you are = on a GPT system) or UFS IDs (/dev/ufsid/xxx) if you can't. >=20 > I've been running with ufs labels for a couple of years now, since the = first rumblings of this hit the streets. They work great no matter what = the underlying partitioning scheme. The one drawback is that if you = have multiple disks with the same labels, then the first one wins. = Normally not a problem, but when you have it, you need to ensure the = right one is selected. I avoid this problem by prefixing a hostname to = the label... This is why I prefer IDs since they are nominally unique (UFS ones, GPTs = damn well better be :) Although I concede it is rather annoying to work out which is which, or = type them out manually.. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 09:00:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC05F106566B; Mon, 25 Apr 2011 09:00:52 +0000 (UTC) (envelope-from ticso@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA6BF8FC0A; Mon, 25 Apr 2011 09:00:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3P90qeH068664; Mon, 25 Apr 2011 09:00:52 GMT (envelope-from ticso@svn.freebsd.org) Received: (from ticso@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3P90qXr068662; Mon, 25 Apr 2011 09:00:52 GMT (envelope-from ticso@svn.freebsd.org) Message-Id: <201104250900.p3P90qXr068662@svn.freebsd.org> From: Bernd Walter Date: Mon, 25 Apr 2011 09:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221009 - head/sys/netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 09:00:52 -0000 Author: ticso Date: Mon Apr 25 09:00:52 2011 New Revision: 221009 URL: http://svn.freebsd.org/changeset/base/221009 Log: correct variable type name in comment Modified: head/sys/netinet6/in6.h Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Mon Apr 25 06:36:26 2011 (r221008) +++ head/sys/netinet6/in6.h Mon Apr 25 09:00:52 2011 (r221009) @@ -397,8 +397,8 @@ struct route_in6 { #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */ #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */ #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */ -#define IPV6_JOIN_GROUP 12 /* ip6_mreq; join a group membership */ -#define IPV6_LEAVE_GROUP 13 /* ip6_mreq; leave a group membership */ +#define IPV6_JOIN_GROUP 12 /* ipv6_mreq; join a group membership */ +#define IPV6_LEAVE_GROUP 13 /* ipv6_mreq; leave a group membership */ #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */ #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */ /* RFC2292 options */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 09:18:05 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6744106566B; Mon, 25 Apr 2011 09:18:05 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4A5F8FC08; Mon, 25 Apr 2011 09:18:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3P9I5We069192; Mon, 25 Apr 2011 09:18:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3P9I5EY069190; Mon, 25 Apr 2011 09:18:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201104250918.p3P9I5EY069190@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 25 Apr 2011 09:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221010 - head/sys/dev/ichwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 09:18:06 -0000 Author: des Date: Mon Apr 25 09:18:05 2011 New Revision: 221010 URL: http://svn.freebsd.org/changeset/base/221010 Log: Whitespace nit Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Mon Apr 25 09:00:52 2011 (r221009) +++ head/sys/dev/ichwd/ichwd.c Mon Apr 25 09:18:05 2011 (r221010) @@ -228,8 +228,8 @@ ichwd_sts_reset(struct ichwd_softc *sc) * by writing a 1, not a 0. */ ichwd_write_tco_2(sc, TCO1_STS, TCO_TIMEOUT); - /* - * According to Intel's docs, clearing SECOND_TO_STS and BOOT_STS must + /* + * According to Intel's docs, clearing SECOND_TO_STS and BOOT_STS must * be done in two separate operations. */ ichwd_write_tco_2(sc, TCO2_STS, TCO_SECOND_TO_STS); From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 10:08:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03498106566B; Mon, 25 Apr 2011 10:08:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5A688FC0A; Mon, 25 Apr 2011 10:08:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PA8YKA070779; Mon, 25 Apr 2011 10:08:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PA8Y7E070777; Mon, 25 Apr 2011 10:08:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201104251008.p3PA8Y7E070777@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Apr 2011 10:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221011 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 10:08:35 -0000 Author: jilles Date: Mon Apr 25 10:08:34 2011 New Revision: 221011 URL: http://svn.freebsd.org/changeset/base/221011 Log: sh: Remove duplicate code resetting uid/gid for set +p/+o privileged. MFC after: 1 week Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Mon Apr 25 09:18:05 2011 (r221010) +++ head/bin/sh/options.c Mon Apr 25 10:08:34 2011 (r221011) @@ -198,13 +198,8 @@ options(int cmdline) minus_o(*argptr, val); if (*argptr) argptr++; - } else { - if (c == 'p' && !val && privileged) { - (void) setuid(getuid()); - (void) setgid(getgid()); - } + } else setoption(c, val); - } } } return; @@ -271,10 +266,6 @@ minus_o(char *name, int val) } else { for (i = 0; i < NOPTS; i++) if (equal(name, optlist[i].name)) { - if (!val && privileged && equal(name, "privileged")) { - (void) setuid(getuid()); - (void) setgid(getgid()); - } setoption(optlist[i].letter, val); return; } @@ -288,6 +279,10 @@ setoption(int flag, int val) { int i; + if (flag == 'p' && !val && privileged) { + (void) setuid(getuid()); + (void) setgid(getgid()); + } for (i = 0; i < NOPTS; i++) if (optlist[i].letter == flag) { optlist[i].val = val; From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 10:14:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 094EA106564A; Mon, 25 Apr 2011 10:14:30 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBC4C8FC08; Mon, 25 Apr 2011 10:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PAEThV070988; Mon, 25 Apr 2011 10:14:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PAETAM070986; Mon, 25 Apr 2011 10:14:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201104251014.p3PAETAM070986@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Apr 2011 10:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221012 - head/bin/sh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 10:14:30 -0000 Author: jilles Date: Mon Apr 25 10:14:29 2011 New Revision: 221012 URL: http://svn.freebsd.org/changeset/base/221012 Log: sh: Check setuid()/setgid() return values. If the -p option is turned off, privileges from a setuid or setgid binary are dropped. Make sure to check if this succeeds. If it fails, this is an error which will cause the shell to abort except in interactive mode or if 'command' was used to make 'set' or an outer 'eval' or '.' non-special. Note that taking advantage of this feature and writing setuid shell scripts seems unwise. MFC after: 1 week Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Mon Apr 25 10:08:34 2011 (r221011) +++ head/bin/sh/options.c Mon Apr 25 10:14:29 2011 (r221012) @@ -280,8 +280,10 @@ setoption(int flag, int val) int i; if (flag == 'p' && !val && privileged) { - (void) setuid(getuid()); - (void) setgid(getgid()); + if (setgid(getgid()) == -1) + error("setgid"); + if (setuid(getuid()) == -1) + error("setuid"); } for (i = 0; i < NOPTS; i++) if (optlist[i].letter == flag) { From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 12:36:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7216106566C; Mon, 25 Apr 2011 12:36:29 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B683B8FC14; Mon, 25 Apr 2011 12:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PCaTgw076479; Mon, 25 Apr 2011 12:36:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PCaTYb076477; Mon, 25 Apr 2011 12:36:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201104251236.p3PCaTYb076477@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Apr 2011 12:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221013 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 12:36:29 -0000 Author: jilles Date: Mon Apr 25 12:36:29 2011 New Revision: 221013 URL: http://svn.freebsd.org/changeset/base/221013 Log: printf(1): Mention effect of '#' modifier on other conversions. Modified: head/usr.bin/printf/printf.1 Modified: head/usr.bin/printf/printf.1 ============================================================================== --- head/usr.bin/printf/printf.1 Mon Apr 25 10:14:29 2011 (r221012) +++ head/usr.bin/printf/printf.1 Mon Apr 25 12:36:29 2011 (r221013) @@ -31,7 +31,7 @@ .\" @(#)printf.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 19, 2010 +.Dd April 25, 2011 .Dt PRINTF 1 .Os .Sh NAME @@ -125,9 +125,9 @@ in the following order: A `#' character specifying that the value should be printed in an ``alternate form''. For -.Cm c , d , +.Cm b , c , d , s and -.Cm s , +.Cm u formats, this option has no effect. For the .Cm o @@ -141,9 +141,9 @@ format, a non-zero result has the string .Pq Li 0X prepended to it. For -.Cm e , E , f , g , +.Cm a , A , e , E , f , F , g and -.Cm G , +.Cm G formats, the result will always contain a decimal point, even if no digits follow the point (normally, a decimal point only appears in the results of those formats if a digit follows the decimal point). From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 13:09:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 058B01065670; Mon, 25 Apr 2011 13:09:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E835F8FC23; Mon, 25 Apr 2011 13:09:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PD9WsM077436; Mon, 25 Apr 2011 13:09:32 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PD9WW8077432; Mon, 25 Apr 2011 13:09:32 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104251309.p3PD9WW8077432@svn.freebsd.org> From: Rick Macklem Date: Mon, 25 Apr 2011 13:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221014 - in head/sys: fs/nfs fs/nfsclient nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 13:09:33 -0000 Author: rmacklem Date: Mon Apr 25 13:09:32 2011 New Revision: 221014 URL: http://svn.freebsd.org/changeset/base/221014 Log: Modify the experimental NFS client so that it uses the same "struct nfs_args" as the regular NFS client. This is needed so that the old mount(2) syscall will work and it makes sharing of the diskless NFS root code easier. Eary in the porting exercise I introduced a new revision of nfs_args, but didn't actually need it, thanks to nmount(2). I re-introduced the NFSMNT_KERB flag, since it does essentially the same thing and the old one would not have been used because it never worked. I also added a few new NFSMNT_xxx flags to sys/nfsclient/nfs_args.h that are used by the experimental NFS client. MFC after: 2 weeks Deleted: head/sys/fs/nfsclient/nfsargs.h Modified: head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfsargs.h Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Mon Apr 25 12:36:29 2011 (r221013) +++ head/sys/fs/nfs/nfsport.h Mon Apr 25 13:09:32 2011 (r221014) @@ -372,7 +372,7 @@ struct ext_nfsstats { #include #include #include -#include +#include #include /* Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Mon Apr 25 12:36:29 2011 (r221013) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Mon Apr 25 13:09:32 2011 (r221014) @@ -102,8 +102,9 @@ static void nfs_decode_args(struct mount struct nfs_args *argp, const char *, struct ucred *, struct thread *); static int mountnfs(struct nfs_args *, struct mount *, - struct sockaddr *, char *, u_char *, u_char *, u_char *, - struct vnode **, struct ucred *, struct thread *, int); + struct sockaddr *, char *, u_char *, int, u_char *, int, + u_char *, int, struct vnode **, struct ucred *, + struct thread *, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -503,11 +504,21 @@ nfs_mountdiskless(char *path, struct vnode **vpp, struct mount *mp) { struct sockaddr *nam; - int error; + int dirlen, error; + char *dirpath; + /* + * Find the directory path in "path", which also has the server's + * name/ip address in it. + */ + dirpath = strchr(path, ':'); + if (dirpath != NULL) + dirlen = strlen(++dirpath); + else + dirlen = 0; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); - if ((error = mountnfs(args, mp, nam, path, NULL, NULL, NULL, vpp, - td->td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen, + NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -735,14 +746,10 @@ nfs_mount(struct mount *mp) .readahead = NFS_DEFRAHEAD, .wcommitsize = 0, /* was: NQ_DEFLEASE */ .hostname = NULL, - /* args version 4 */ .acregmin = NFS_MINATTRTIMO, .acregmax = NFS_MAXATTRTIMO, .acdirmin = NFS_MINDIRATTRTIMO, .acdirmax = NFS_MAXDIRATTRTIMO, - .dirlen = 0, - .krbnamelen = 0, - .srvkrbnamelen = 0, }; int error = 0, ret, len; struct sockaddr *nam = NULL; @@ -752,6 +759,7 @@ nfs_mount(struct mount *mp) u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *opt, *name, *secname; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; + int dirlen, krbnamelen, srvkrbnamelen; if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; @@ -1008,19 +1016,19 @@ nfs_mount(struct mount *mp) strlcpy(srvkrbname, name, sizeof (srvkrbname)); else snprintf(srvkrbname, sizeof (srvkrbname), "nfs@%s", hst); - args.srvkrbnamelen = strlen(srvkrbname); + srvkrbnamelen = strlen(srvkrbname); if (vfs_getopt(mp->mnt_optnew, "gssname", (void **)&name, NULL) == 0) strlcpy(krbname, name, sizeof (krbname)); else krbname[0] = '\0'; - args.krbnamelen = strlen(krbname); + krbnamelen = strlen(krbname); if (vfs_getopt(mp->mnt_optnew, "dirpath", (void **)&name, NULL) == 0) strlcpy(dirpath, name, sizeof (dirpath)); else dirpath[0] = '\0'; - args.dirlen = strlen(dirpath); + dirlen = strlen(dirpath); if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr, &args.addrlen) == 0) { @@ -1034,8 +1042,9 @@ nfs_mount(struct mount *mp) } args.fh = nfh; - error = mountnfs(&args, mp, nam, hst, krbname, dirpath, srvkrbname, - &vp, td->td_ucred, td, negnametimeo); + error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, + dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, + negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1077,9 +1086,9 @@ nfs_cmount(struct mntarg *ma, void *data */ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, - char *hst, u_char *krbname, u_char *dirpath, u_char *srvkrbname, - struct vnode **vpp, struct ucred *cred, struct thread *td, - int negnametimeo) + char *hst, u_char *krbname, int krbnamelen, u_char *dirpath, int dirlen, + u_char *srvkrbname, int srvkrbnamelen, struct vnode **vpp, + struct ucred *cred, struct thread *td, int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1094,17 +1103,15 @@ mountnfs(struct nfs_args *argp, struct m return (0); } else { MALLOC(nmp, struct nfsmount *, sizeof (struct nfsmount) + - argp->krbnamelen + argp->dirlen + argp->srvkrbnamelen + 2, - M_NEWNFSMNT, M_WAITOK); - bzero((caddr_t)nmp, sizeof (struct nfsmount) + - argp->krbnamelen + argp->dirlen + argp->srvkrbnamelen + 2); + krbnamelen + dirlen + srvkrbnamelen + 2, + M_NEWNFSMNT, M_WAITOK | M_ZERO); TAILQ_INIT(&nmp->nm_bufq); if (clval == 0) clval = (u_int64_t)nfsboottime.tv_sec; nmp->nm_clval = clval++; - nmp->nm_krbnamelen = argp->krbnamelen; - nmp->nm_dirpathlen = argp->dirlen; - nmp->nm_srvkrbnamelen = argp->srvkrbnamelen; + nmp->nm_krbnamelen = krbnamelen; + nmp->nm_dirpathlen = dirlen; + nmp->nm_srvkrbnamelen = srvkrbnamelen; if (td->td_ucred->cr_uid != (uid_t)0) { /* * nm_uid is used to get KerberosV credentials for Modified: head/sys/nfsclient/nfsargs.h ============================================================================== --- head/sys/nfsclient/nfsargs.h Mon Apr 25 12:36:29 2011 (r221013) +++ head/sys/nfsclient/nfsargs.h Mon Apr 25 13:09:32 2011 (r221014) @@ -78,7 +78,7 @@ struct nfs_args { #define NFSMNT_NOCONN 0x00000080 /* Don't Connect the socket */ /* 0x100 free, was NFSMNT_NQNFS */ #define NFSMNT_NFSV3 0x00000200 /* Use NFS Version 3 protocol */ -/* 0x400 free, was NFSMNT_KERB */ +#define NFSMNT_KERB 0x00000400 /* Use RPCSEC_GSS/Krb5 */ #define NFSMNT_DUMBTIMR 0x00000800 /* Don't estimate rtt dynamically */ #define NFSMNT_WCOMMITSIZE 0x00001000 /* set max write commit size */ #define NFSMNT_READAHEAD 0x00002000 /* set read ahead */ @@ -93,5 +93,9 @@ struct nfs_args { #define NFSMNT_NOLOCKD 0x00400000 /* Locks are local */ #define NFSMNT_NFSV4 0x00800000 /* Use NFS Version 4 protocol */ #define NFSMNT_HASWRITEVERF 0x01000000 /* NFSv4 Write verifier */ +#define NFSMNT_INTEGRITY 0x02000000 /* Use integrity with RPCSEC_GSS */ +#define NFSMNT_PRIVACY 0x04000000 /* Use privacy with RPCSEC_GSS */ +#define NFSMNT_ALLGSSNAME 0x08000000 /* Use principal for all accesses */ +#define NFSMNT_STRICT3530 0x10000000 /* Adhere strictly to RFC3530 */ #endif From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 13:45:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAF44106566C; Mon, 25 Apr 2011 13:45:50 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 4C4FB8FC1B; Mon, 25 Apr 2011 13:45:49 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 6F82E45E93; Mon, 25 Apr 2011 15:45:47 +0200 (CEST) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 54B8B45C9C; Mon, 25 Apr 2011 15:45:42 +0200 (CEST) Date: Mon, 25 Apr 2011 15:45:31 +0200 From: Pawel Jakub Dawidek To: "Bjoern A. Zeeb" Message-ID: <20110425134531.GA4391@garage.freebsd.pl> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/04w6evG8XlLl3ft" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, Robert Watson , svn-src-all@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 13:45:50 -0000 --/04w6evG8XlLl3ft Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: > I had been pondering devfs "link"s myself, the problem is that from the rc > framework they come too late. If you can add a simple .ko that does it > programmatically on 9 that would be great. The problem is that after boo= ting > the new kernel you don't know whether people had ATA_STATIC on or not, so > we'd have to go with the defaults, that were in 8.x (and an extra tunable= to > flip the logic maybe)? We do know that people have ATA_STATIC_ID, because if they don't, this means they have their custom kernel config which doesn't contain ATA_CAM and when they will use it next time they recompile their kernel they will still have /dev/adX entries. Also, as Alexander already noted, because of all the problems with ATA naming over the years and for other reasons too, people often hardcode provider name in various GEOM classes metadata, so symlink won't help. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --/04w6evG8XlLl3ft Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk21evsACgkQForvXbEpPzSiXgCdFc2yODBwMNTpDw6Gehhyrbbx m+wAoPaAqKa9eaE9cvHbit2UBBzBaeIL =Xifb -----END PGP SIGNATURE----- --/04w6evG8XlLl3ft-- From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 14:10:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1965106564A; Mon, 25 Apr 2011 14:10:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C25168FC08; Mon, 25 Apr 2011 14:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PEAXRX079288; Mon, 25 Apr 2011 14:10:33 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PEAXY9079286; Mon, 25 Apr 2011 14:10:33 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201104251410.p3PEAXY9079286@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Apr 2011 14:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221015 - head/sys/dev/ichwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 14:10:33 -0000 Author: attilio Date: Mon Apr 25 14:10:33 2011 New Revision: 221015 URL: http://svn.freebsd.org/changeset/base/221015 Log: Don't assume that SMI are enabled when attaching ichwd and then do correct unwind based on former state. Sponsored by: Sandvine Incorporated Reviewed by: des MFC after: 1 week Modified: head/sys/dev/ichwd/ichwd.h Modified: head/sys/dev/ichwd/ichwd.h ============================================================================== --- head/sys/dev/ichwd/ichwd.h Mon Apr 25 13:09:32 2011 (r221014) +++ head/sys/dev/ichwd/ichwd.h Mon Apr 25 14:10:33 2011 (r221015) @@ -45,6 +45,7 @@ struct ichwd_softc { int active; unsigned int timeout; + int smi_enabled; int smi_rid; struct resource *smi_res; bus_space_tag_t smi_bst; From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 14:12:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 736C61065676; Mon, 25 Apr 2011 14:12:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 645638FC12; Mon, 25 Apr 2011 14:12:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PECw3Q079425; Mon, 25 Apr 2011 14:12:58 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PECwb4079423; Mon, 25 Apr 2011 14:12:58 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201104251412.p3PECwb4079423@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Apr 2011 14:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221016 - head/sys/dev/ichwd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 14:12:58 -0000 Author: attilio Date: Mon Apr 25 14:12:58 2011 New Revision: 221016 URL: http://svn.freebsd.org/changeset/base/221016 Log: Add missing bit in r221015. Sponsored by: Sandvine Incorporated Reviewed by: des MFC after: 1 week X-MFC: r221015 Modified: head/sys/dev/ichwd/ichwd.c Modified: head/sys/dev/ichwd/ichwd.c ============================================================================== --- head/sys/dev/ichwd/ichwd.c Mon Apr 25 14:10:33 2011 (r221015) +++ head/sys/dev/ichwd/ichwd.c Mon Apr 25 14:12:58 2011 (r221016) @@ -217,6 +217,15 @@ ichwd_smi_enable(struct ichwd_softc *sc) } /* + * Check if the watchdog SMI triggering is enabled. + */ +static __inline int +ichwd_smi_is_enabled(struct ichwd_softc *sc) +{ + return ((ichwd_read_smi_4(sc, SMI_EN) & SMI_TCO_EN) != 0); +} + +/* * Reset the watchdog status bits. */ static __inline void @@ -534,6 +543,7 @@ ichwd_attach(device_t dev) sc->ev_tag = EVENTHANDLER_REGISTER(watchdog_list, ichwd_event, sc, 0); /* disable the SMI handler */ + sc->smi_enabled = ichwd_smi_is_enabled(sc); ichwd_smi_disable(sc); return (0); @@ -565,7 +575,8 @@ ichwd_detach(device_t dev) ichwd_tmr_disable(sc); /* enable the SMI handler */ - ichwd_smi_enable(sc); + if (sc->smi_enabled != 0) + ichwd_smi_enable(sc); /* deregister event handler */ if (sc->ev_tag != NULL) From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 14:51:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A74A10656D0; Mon, 25 Apr 2011 14:51:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B51C8FC16; Mon, 25 Apr 2011 14:51:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PEp9WT080718; Mon, 25 Apr 2011 14:51:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PEp9Hv080716; Mon, 25 Apr 2011 14:51:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104251451.p3PEp9Hv080716@svn.freebsd.org> From: Rick Macklem Date: Mon, 25 Apr 2011 14:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221018 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 14:51:09 -0000 Author: rmacklem Date: Mon Apr 25 14:51:08 2011 New Revision: 221018 URL: http://svn.freebsd.org/changeset/base/221018 Log: Fix the experimental NFS client so that it does not bogusly set the f_flags field of "struct statfs". This had the interesting effect of making the NFSv4 mounts "disappear" after r221014, since NFSMNT_NFSV4 and MNT_IGNORE became the same bit. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Mon Apr 25 14:36:38 2011 (r221017) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Mon Apr 25 14:51:08 2011 (r221018) @@ -318,7 +318,6 @@ nfs_statfs(struct mount *mp, struct stat if (gotfsinfo || (nmp->nm_flag & NFSMNT_NFSV4)) nfscl_loadfsinfo(nmp, &fs); nfscl_loadsbinfo(nmp, &sb, sbp); - sbp->f_flags = nmp->nm_flag; sbp->f_iosize = newnfs_iosize(nmp); mtx_unlock(&nmp->nm_mtx); if (sbp != &mp->mnt_stat) { From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 15:36:52 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D184A106566B; Mon, 25 Apr 2011 15:36:52 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 890A08FC15; Mon, 25 Apr 2011 15:36:52 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3PFVUXW021321 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 25 Apr 2011 09:31:32 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au> Date: Mon, 25 Apr 2011 09:31:31 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201104240923.p3O9N8QG025386@svn.freebsd.org> <20110424161933.GA18775@vniz.net> <18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au> <34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au> To: "Daniel O'Connor" X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 25 Apr 2011 09:31:32 -0600 (MDT) Cc: svn-src-head@FreeBSD.org, Alexander Motin , src-committers@FreeBSD.org, Andrey Chernov , svn-src-all@FreeBSD.org Subject: Re: svn commit: r220983 - head X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 15:36:52 -0000 On Apr 25, 2011, at 12:52 AM, Daniel O'Connor wrote: >=20 > On 25/04/2011, at 6:55, Warner Losh wrote: >>> The best way is to change to use GPT IDs (/dev/gptid/xxx) if you are = on a GPT system) or UFS IDs (/dev/ufsid/xxx) if you can't. >>=20 >> I've been running with ufs labels for a couple of years now, since = the first rumblings of this hit the streets. They work great no matter = what the underlying partitioning scheme. The one drawback is that if = you have multiple disks with the same labels, then the first one wins. = Normally not a problem, but when you have it, you need to ensure the = right one is selected. I avoid this problem by prefixing a hostname to = the label... >=20 > This is why I prefer IDs since they are nominally unique (UFS ones, = GPTs damn well better be :) >=20 > Although I concede it is rather annoying to work out which is which, = or type them out manually.. For things like ZFS, UUIDs aren't so bad because it hides them. For things like /etc/fstab, I prefer the named approach. This allows me = to survive a newfs on a partition if I have to without having to hack my = /etc/fstab. I have a large /tmp partition at times, and it gets newfs'd = if there's a bad problem... Warner From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 15:37:05 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6133106571B; Mon, 25 Apr 2011 15:37:05 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3108FC19; Mon, 25 Apr 2011 15:37:05 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3PFYCxT021338 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 25 Apr 2011 09:34:12 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110425134531.GA4391@garage.freebsd.pl> Date: Mon, 25 Apr 2011 09:34:12 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 25 Apr 2011 09:34:12 -0600 (MDT) Cc: src-committers@FreeBSD.org, Alexander Motin , "Bjoern A. Zeeb" , Robert Watson , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 15:37:05 -0000 On Apr 25, 2011, at 7:45 AM, Pawel Jakub Dawidek wrote: > On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: >> I had been pondering devfs "link"s myself, the problem is that from = the rc >> framework they come too late. If you can add a simple .ko that does = it >> programmatically on 9 that would be great. The problem is that after = booting >> the new kernel you don't know whether people had ATA_STATIC on or = not, so >> we'd have to go with the defaults, that were in 8.x (and an extra = tunable to >> flip the logic maybe)? >=20 > We do know that people have ATA_STATIC_ID, because if they don't, this > means they have their custom kernel config which doesn't contain = ATA_CAM > and when they will use it next time they recompile their kernel they > will still have /dev/adX entries. >=20 > Also, as Alexander already noted, because of all the problems with ATA > naming over the years and for other reasons too, people often hardcode > provider name in various GEOM classes metadata, so symlink won't help. Do we have a short list of the places to look? A lot of this could be = done with a script that gets run at installworld and boot time to hunt = down the old cases and report them to the user before they upgrade their = kernel (but this would mean backing out the GENERIC change for a while = to give people a chance to upgrade to label-based provisioning... Warner From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 15:51:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66CF71065678; Mon, 25 Apr 2011 15:51:49 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 522128FC1E; Mon, 25 Apr 2011 15:51:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PFpn5G082487; Mon, 25 Apr 2011 15:51:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PFpnoS082485; Mon, 25 Apr 2011 15:51:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201104251551.p3PFpnoS082485@svn.freebsd.org> From: Adrian Chadd Date: Mon, 25 Apr 2011 15:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221019 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 15:51:49 -0000 Author: adrian Date: Mon Apr 25 15:51:49 2011 New Revision: 221019 URL: http://svn.freebsd.org/changeset/base/221019 Log: Wrap the MIMO stuff in #ifdef AH_SUPPORT_AR5416, as the channel state doesn't have MIMO stuff in it by default. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Mon Apr 25 14:51:08 2011 (r221018) +++ head/sys/dev/ath/ath_hal/ah.c Mon Apr 25 15:51:49 2011 (r221019) @@ -906,6 +906,7 @@ ath_hal_get_mimo_chan_noise(struct ath_h const struct ieee80211_channel *chan, int16_t *nf_ctl, int16_t *nf_ext) { +#ifdef AH_SUPPORT_AR5416 HAL_CHANNEL_INTERNAL *ichan; int i; @@ -960,6 +961,9 @@ ath_hal_get_mimo_chan_noise(struct ath_h } return 1; } +#else + return 0; +#endif /* AH_SUPPORT_AR5416 */ } /* From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 16:29:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5E7C106566C; Mon, 25 Apr 2011 16:29:34 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4209A8FC17; Mon, 25 Apr 2011 16:29:33 +0000 (UTC) Received: by bwz12 with SMTP id 12so2707051bwz.13 for ; Mon, 25 Apr 2011 09:29:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=KDxuBPxlUZI6ADIv/alMArDSHUZ0JDGNTmwhA/OwQZU=; b=drZ+1/GW2ZyVwmE+EMzVELNrf904/XK8ply3efs55tdoeU7OxwM13bv3D4t9T+A2TK 3kl8lt95iW6ZuEelAvGMb4RKGj7smPE8S3yK+Q6syII1D84kImMv1vYssU/fqWT2/EJf +gS42N8oxgT6+e0CnfzDxQURxBCIE///eloK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=sdQ83LOyV4JHq98OSOOdcWBCWrvVRyh9/2et2vgn89TpcrxpaISOlCgdGWKTzBqGSe v11J0w9T4QkVP/zNgyoIZ2SJ7pw4PPVkHGzVoNNWgIC6R65K4oRNMUnCcrB0KdIHQq27 vcHQKgAD4QnyC1dvlmGR5W86A5REn0Dt1zMKU= Received: by 10.204.83.228 with SMTP id g36mr3592600bkl.30.1303748972241; Mon, 25 Apr 2011 09:29:32 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l1sm3350045bkl.13.2011.04.25.09.29.30 (version=SSLv3 cipher=OTHER); Mon, 25 Apr 2011 09:29:31 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB5A166.9010302@FreeBSD.org> Date: Mon, 25 Apr 2011 19:29:26 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Warner Losh References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> In-Reply-To: <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@FreeBSD.org, Pawel Jakub Dawidek , svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@FreeBSD.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 16:29:35 -0000 Warner Losh wrote: > On Apr 25, 2011, at 7:45 AM, Pawel Jakub Dawidek wrote: >> On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: >>> I had been pondering devfs "link"s myself, the problem is that from the rc >>> framework they come too late. If you can add a simple .ko that does it >>> programmatically on 9 that would be great. The problem is that after booting >>> the new kernel you don't know whether people had ATA_STATIC on or not, so >>> we'd have to go with the defaults, that were in 8.x (and an extra tunable to >>> flip the logic maybe)? >> We do know that people have ATA_STATIC_ID, because if they don't, this >> means they have their custom kernel config which doesn't contain ATA_CAM >> and when they will use it next time they recompile their kernel they >> will still have /dev/adX entries. >> >> Also, as Alexander already noted, because of all the problems with ATA >> naming over the years and for other reasons too, people often hardcode >> provider name in various GEOM classes metadata, so symlink won't help. > > Do we have a short list of the places to look? Quick man pages grepping shows that at least gmirror, gstripe, graid3, gjournal, gvirstor, gconcat, gshsec support provider names hardcoding. For gmirror and graid3 present status can be obtained by: `gXXX list | egrep "Flags: .*HARDCODED"`. For gvirstor, gshsec, gstripe and gconcat: `gXXX dump adX | egrep "Hardcoded provider: ad"`. For gjournal: `gjournal dump adX | egrep "hcprovider: ad"`. > A lot of this could be done with a script that gets run at installworld and boot time to hunt down the old cases and report them to the user before they upgrade their kernel (but this would mean backing out the GENERIC change for a while to give people a chance to upgrade to label-based provisioning... If I understand idea right, independently of how much we delay it, there will be some people who not updated during that window to get in code detecting it during boot. Hardly many people of target auditory updating their systems each month. Same time some checks indeed could be done in installkernel. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 16:33:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 462841065672; Mon, 25 Apr 2011 16:33:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29C978FC12; Mon, 25 Apr 2011 16:33:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PGXhLW083778; Mon, 25 Apr 2011 16:33:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PGXh6c083776; Mon, 25 Apr 2011 16:33:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201104251633.p3PGXh6c083776@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Apr 2011 16:33:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221020 - head/sys/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 16:33:43 -0000 Author: bz Date: Mon Apr 25 16:33:42 2011 New Revision: 221020 URL: http://svn.freebsd.org/changeset/base/221020 Log: After r220885 compile the various NIC drivers depending on INET unconditionally backing out r193997, so that they are available for IPv6-only setups as well. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 5 days Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Apr 25 15:51:49 2011 (r221019) +++ head/sys/conf/files Mon Apr 25 16:33:42 2011 (r221020) @@ -493,7 +493,7 @@ dev/advansys/adwcam.c optional adw dev/advansys/adwlib.c optional adw dev/advansys/adwmcode.c optional adw dev/ae/if_ae.c optional ae pci -dev/age/if_age.c optional age pci inet +dev/age/if_age.c optional age pci dev/agp/agp.c optional agp pci dev/agp/agp_if.m optional agp pci dev/aha/aha.c optional aha @@ -515,8 +515,8 @@ dev/aic7xxx/aic7xxx.c optional ahc dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci -dev/alc/if_alc.c optional alc pci inet -dev/ale/if_ale.c optional ale pci inet +dev/alc/if_alc.c optional alc pci +dev/ale/if_ale.c optional ale pci dev/amd/amd.c optional amd dev/amr/amr.c optional amr dev/amr/amr_cam.c optional amrp amr @@ -973,11 +973,11 @@ dev/ed/if_ed_pccard.c optional ed pccar dev/ed/if_ed_pci.c optional ed pci dev/eisa/eisa_if.m standard dev/eisa/eisaconf.c optional eisa -dev/e1000/if_em.c optional em inet \ +dev/e1000/if_em.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/if_lem.c optional em inet \ +dev/e1000/if_lem.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" -dev/e1000/if_igb.c optional igb inet \ +dev/e1000/if_igb.c optional igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_80003es2lan.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" @@ -1046,7 +1046,7 @@ dev/firewire/sbp.c optional sbp dev/firewire/sbp_targ.c optional sbp_targ dev/flash/at45d.c optional at45d dev/flash/mx25l.c optional mx25l -dev/fxp/if_fxp.c optional fxp inet +dev/fxp/if_fxp.c optional fxp dev/gem/if_gem.c optional gem dev/gem/if_gem_pci.c optional gem pci dev/gem/if_gem_sbus.c optional gem sbus @@ -1336,7 +1336,7 @@ dev/ixgbe/ixgbe_82598.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_82599.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/jme/if_jme.c optional jme pci inet +dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa dev/joy/joy_pccard.c optional joy pccard @@ -1425,7 +1425,7 @@ dev/mpt/mpt_debug.c optional mpt dev/mpt/mpt_pci.c optional mpt pci dev/mpt/mpt_raid.c optional mpt dev/mpt/mpt_user.c optional mpt -dev/msk/if_msk.c optional msk inet +dev/msk/if_msk.c optional msk dev/mvs/mvs.c optional mvs dev/mvs/mvs_if.m optional mvs dev/mvs/mvs_pci.c optional mvs pci @@ -1639,7 +1639,7 @@ dev/siba/siba_bwn.c optional siba_bwn p dev/siba/siba_core.c optional siba_bwn pci dev/siis/siis.c optional siis pci dev/sis/if_sis.c optional sis pci -dev/sk/if_sk.c optional sk pci inet +dev/sk/if_sk.c optional sk pci dev/smbus/smb.c optional smb dev/smbus/smbconf.c optional smbus dev/smbus/smbus.c optional smbus @@ -1788,7 +1788,7 @@ dev/twa/tw_osl_freebsd.c optional twa \ dev/twe/twe.c optional twe dev/twe/twe_freebsd.c optional twe dev/tx/if_tx.c optional tx -dev/txp/if_txp.c optional txp inet +dev/txp/if_txp.c optional txp dev/uart/uart_bus_acpi.c optional uart acpi #dev/uart/uart_bus_cbus.c optional uart cbus dev/uart/uart_bus_ebus.c optional uart ebus From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 16:36:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C4DC106564A; Mon, 25 Apr 2011 16:36:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0F38FC1F; Mon, 25 Apr 2011 16:36:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PGaGSc083885; Mon, 25 Apr 2011 16:36:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PGaG8n083883; Mon, 25 Apr 2011 16:36:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201104251636.p3PGaG8n083883@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Apr 2011 16:36:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221021 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 16:36:16 -0000 Author: bz Date: Mon Apr 25 16:36:16 2011 New Revision: 221021 URL: http://svn.freebsd.org/changeset/base/221021 Log: Be less strict on includes than in r220746. We need in.h for both INET or INET6 as it holds all the IPPROTO_* definitions needed for the SYSCTL_NODE definitions. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 5 days Modified: head/sys/netinet/in_proto.c Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon Apr 25 16:33:42 2011 (r221020) +++ head/sys/netinet/in_proto.c Mon Apr 25 16:36:16 2011 (r221021) @@ -64,8 +64,13 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#endif /* INET */ +#if defined(INET) || defined(INET6) #include +#endif + +#ifdef INET #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 16:37:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB38B106566B; Mon, 25 Apr 2011 16:37:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AAE888FC19; Mon, 25 Apr 2011 16:37:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PGbls5083961; Mon, 25 Apr 2011 16:37:47 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PGblqu083959; Mon, 25 Apr 2011 16:37:47 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201104251637.p3PGblqu083959@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 25 Apr 2011 16:37:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221022 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 16:37:47 -0000 Author: bz Date: Mon Apr 25 16:37:47 2011 New Revision: 221022 URL: http://svn.freebsd.org/changeset/base/221022 Log: We need in.h for both INET and INET6, as according to RFC 3493 it defines struct in6_addr, which is needed by ip6_hdr used in here. Reviewed by: gnn Sponsored by: The FreeBSD Foundation Sponsored by: iXsystems MFC after: 5 days Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Mon Apr 25 16:36:16 2011 (r221021) +++ head/sys/net80211/ieee80211_output.c Mon Apr 25 16:37:47 2011 (r221022) @@ -57,8 +57,11 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef INET +#if defined(INET) || defined(INET6) #include +#endif + +#ifdef INET #include #include #include From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 16:54:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 694A01065675; Mon, 25 Apr 2011 16:54:34 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 19E538FC0A; Mon, 25 Apr 2011 16:54:34 +0000 (UTC) Received: from [10.30.101.54] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3PGs7Nu022039 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 25 Apr 2011 10:54:09 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <4DB5A166.9010302@FreeBSD.org> Date: Mon, 25 Apr 2011 10:54:02 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> To: Alexander Motin X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 25 Apr 2011 10:54:09 -0600 (MDT) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 16:54:34 -0000 On Apr 25, 2011, at 10:29 AM, Alexander Motin wrote: > Warner Losh wrote: >> On Apr 25, 2011, at 7:45 AM, Pawel Jakub Dawidek wrote: >>> On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: >>>> I had been pondering devfs "link"s myself, the problem is that from = the rc >>>> framework they come too late. If you can add a simple .ko that = does it >>>> programmatically on 9 that would be great. The problem is that = after booting >>>> the new kernel you don't know whether people had ATA_STATIC on or = not, so >>>> we'd have to go with the defaults, that were in 8.x (and an extra = tunable to >>>> flip the logic maybe)? >>> We do know that people have ATA_STATIC_ID, because if they don't, = this >>> means they have their custom kernel config which doesn't contain = ATA_CAM >>> and when they will use it next time they recompile their kernel they >>> will still have /dev/adX entries. >>>=20 >>> Also, as Alexander already noted, because of all the problems with = ATA >>> naming over the years and for other reasons too, people often = hardcode >>> provider name in various GEOM classes metadata, so symlink won't = help. >>=20 >> Do we have a short list of the places to look?=20 >=20 > Quick man pages grepping shows that at least gmirror, gstripe, graid3, > gjournal, gvirstor, gconcat, gshsec support provider names hardcoding. > For gmirror and graid3 present status can be obtained by: `gXXX list | > egrep "Flags: .*HARDCODED"`. For gvirstor, gshsec, gstripe and = gconcat: > `gXXX dump adX | egrep "Hardcoded provider: ad"`. For gjournal: > `gjournal dump adX | egrep "hcprovider: ad"`. That wouldn't be too horrible... >> A lot of this could be done with a script that gets run at = installworld and boot time to hunt down the old cases and report them to = the user before they upgrade their kernel (but this would mean backing = out the GENERIC change for a while to give people a chance to upgrade to = label-based provisioning... >=20 > If I understand idea right, independently of how much we delay it, = there > will be some people who not updated during that window to get in code > detecting it during boot. Hardly many people of target auditory = updating > their systems each month. Same time some checks indeed could be done = in > installkernel. We'd have to delay it at least a month, if not more. However, the time = to have done these checks were 8.1ish rather than 9.0 nearing = code-freezeish. I'd thought there was going to be better compatibility = last year at this time, or I'd have pushed this idea harder in the = community... And yes, I'd envisioned installkernel also doing these checks, just to = be complete and prevent foot-shooting. At this point, it's all we have. = For the 9.0 install, we'll likely need to do a subset of this as people = import their gmirrors created with 8.x... Warner >=20 > --=20 > Alexander Motin >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 17:13:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50910106566B; Mon, 25 Apr 2011 17:13:41 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E8D48FC13; Mon, 25 Apr 2011 17:13:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PHDfPL085044; Mon, 25 Apr 2011 17:13:41 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PHDfYl085039; Mon, 25 Apr 2011 17:13:41 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201104251713.p3PHDfYl085039@svn.freebsd.org> From: Attilio Rao Date: Mon, 25 Apr 2011 17:13:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221023 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 17:13:41 -0000 Author: attilio Date: Mon Apr 25 17:13:40 2011 New Revision: 221023 URL: http://svn.freebsd.org/changeset/base/221023 Log: Add the possibility to verify MD5 hash of incoming TCP packets. As long as this is a costy function, even when compiled in (along with the option TCP_SIGNATURE), it can be disabled via the net.inet.tcp.signature_verify_input sysctl. Sponsored by: Sandvine Incorporated Reviewed by: emaste, bz MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Apr 25 16:37:47 2011 (r221022) +++ head/sys/netinet/tcp_input.c Mon Apr 25 17:13:40 2011 (r221023) @@ -215,6 +215,12 @@ static void tcp_pulloutofband(struct so struct tcphdr *, struct mbuf *, int); static void tcp_xmit_timer(struct tcpcb *, int); static void tcp_newreno_partial_ack(struct tcpcb *, struct tcphdr *); +static void inline tcp_fields_to_host(struct tcphdr *); +#ifdef TCP_SIGNATURE +static void inline tcp_fields_to_net(struct tcphdr *); +static int inline tcp_signature_verify_input(struct mbuf *, int, int, + int, struct tcpopt *, struct tcphdr *, u_int); +#endif static void inline cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t type); static void inline cc_conn_init(struct tcpcb *tp); @@ -440,6 +446,40 @@ cc_post_recovery(struct tcpcb *tp, struc tp->t_bytes_acked = 0; } +static inline void +tcp_fields_to_host(struct tcphdr *th) +{ + + th->th_seq = ntohl(th->th_seq); + th->th_ack = ntohl(th->th_ack); + th->th_win = ntohs(th->th_win); + th->th_urp = ntohs(th->th_urp); +} + +#ifdef TCP_SIGNATURE +static inline void +tcp_fields_to_net(struct tcphdr *th) +{ + + th->th_seq = htonl(th->th_seq); + th->th_ack = htonl(th->th_ack); + th->th_win = htons(th->th_win); + th->th_urp = htons(th->th_urp); +} + +static inline int +tcp_signature_verify_input(struct mbuf *m, int off0, int tlen, int optlen, + struct tcpopt *to, struct tcphdr *th, u_int tcpbflag) +{ + int ret; + + tcp_fields_to_net(th); + ret = tcp_signature_verify(m, off0, tlen, optlen, to, th, tcpbflag); + tcp_fields_to_host(th); + return (ret); +} +#endif + /* Neighbor Discovery, Neighbor Unreachability Detection Upper layer hint. */ #ifdef INET6 #define ND6_HINT(tp) \ @@ -519,6 +559,9 @@ tcp_input(struct mbuf *m, int off0) int thflags; int rstreason = 0; /* For badport_bandlim accounting purposes */ uint8_t iptos; +#ifdef TCP_SIGNATURE + uint8_t sig_checked = 0; +#endif #ifdef IPFIREWALL_FORWARD struct m_tag *fwd_tag; #endif @@ -676,10 +719,7 @@ tcp_input(struct mbuf *m, int off0) /* * Convert TCP protocol specific fields to host format. */ - th->th_seq = ntohl(th->th_seq); - th->th_ack = ntohl(th->th_ack); - th->th_win = ntohs(th->th_win); - th->th_urp = ntohs(th->th_urp); + tcp_fields_to_host(th); /* * Delay dropping TCP, IP headers, IPv6 ext headers, and TCP options. @@ -861,8 +901,24 @@ relocked: } INP_INFO_WLOCK_ASSERT(&V_tcbinfo); +#ifdef TCP_SIGNATURE + tcp_dooptions(&to, optp, optlen, + (thflags & TH_SYN) ? TO_SYN : 0); + if (sig_checked == 0) { + tp = intotcpcb(inp); + if (tp == NULL || tp->t_state == TCPS_CLOSED) { + rstreason = BANDLIM_RST_CLOSEDPORT; + goto dropwithreset; + } + if (!tcp_signature_verify_input(m, off0, tlen, optlen, + &to, th, tp->t_flags)) + goto dropunlock; + sig_checked = 1; + } +#else if (thflags & TH_SYN) tcp_dooptions(&to, optp, optlen, TO_SYN); +#endif /* * NB: tcp_twcheck unlocks the INP and frees the mbuf. */ @@ -1021,6 +1077,26 @@ relocked: tp = intotcpcb(inp); KASSERT(tp->t_state == TCPS_SYN_RECEIVED, ("%s: ", __func__)); +#ifdef TCP_SIGNATURE + if (sig_checked == 0) { + tcp_dooptions(&to, optp, optlen, + (thflags & TH_SYN) ? TO_SYN : 0); + if (!tcp_signature_verify_input(m, off0, tlen, + optlen, &to, th, tp->t_flags)) { + + /* + * In SYN_SENT state if it receives an + * RST, it is allowed for further + * processing. + */ + if ((thflags & TH_RST) == 0 || + (tp->t_state == TCPS_SYN_SENT) == 0) + goto dropunlock; + } + sig_checked = 1; + } +#endif + /* * Process the segment and the data it * contains. tcp_do_segment() consumes @@ -1225,6 +1301,25 @@ relocked: return; } +#ifdef TCP_SIGNATURE + if (sig_checked == 0) { + tcp_dooptions(&to, optp, optlen, + (thflags & TH_SYN) ? TO_SYN : 0); + if (!tcp_signature_verify_input(m, off0, tlen, optlen, &to, + th, tp->t_flags)) { + + /* + * In SYN_SENT state if it receives an RST, it is + * allowed for further processing. + */ + if ((thflags & TH_RST) == 0 || + (tp->t_state == TCPS_SYN_SENT) == 0) + goto dropunlock; + } + sig_checked = 1; + } +#endif + /* * Segment belongs to a connection in SYN_SENT, ESTABLISHED or later * state. tcp_do_segment() always consumes the mbuf chain, unlocks Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Mon Apr 25 16:37:47 2011 (r221022) +++ head/sys/netinet/tcp_subr.c Mon Apr 25 17:13:40 2011 (r221023) @@ -213,6 +213,12 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sore &tcp_soreceive_stream, 0, "Using soreceive_stream for TCP sockets"); #endif +#ifdef TCP_SIGNATURE +static int tcp_sig_checksigs = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, signature_verify_input, CTLFLAG_RW, + &tcp_sig_checksigs, 0, "Verify RFC2385 digests on inbound traffic"); +#endif + VNET_DEFINE(uma_zone_t, sack_hole_zone); #define V_sack_hole_zone VNET(sack_hole_zone) @@ -1998,6 +2004,66 @@ tcp_signature_compute(struct mbuf *m, in KEY_FREESAV(&sav); return (0); } + +/* + * Verify the TCP-MD5 hash of a TCP segment. (RFC2385) + * + * Parameters: + * m pointer to head of mbuf chain + * len length of TCP segment data, excluding options + * optlen length of TCP segment options + * buf pointer to storage for computed MD5 digest + * direction direction of flow (IPSEC_DIR_INBOUND or OUTBOUND) + * + * Return 1 if successful, otherwise return 0. + */ +int +tcp_signature_verify(struct mbuf *m, int off0, int tlen, int optlen, + struct tcpopt *to, struct tcphdr *th, u_int tcpbflag) +{ + char tmpdigest[TCP_SIGLEN]; + + if (tcp_sig_checksigs == 0) + return (1); + if ((tcpbflag & TF_SIGNATURE) == 0) { + if ((to->to_flags & TOF_SIGNATURE) != 0) { + + /* + * If this socket is not expecting signature but + * the segment contains signature just fail. + */ + TCPSTAT_INC(tcps_sig_err_sigopt); + TCPSTAT_INC(tcps_sig_rcvbadsig); + return (0); + } + + /* Signature is not expected, and not present in segment. */ + return (1); + } + + /* + * If this socket is expecting signature but the segment does not + * contain any just fail. + */ + if ((to->to_flags & TOF_SIGNATURE) == 0) { + TCPSTAT_INC(tcps_sig_err_nosigopt); + TCPSTAT_INC(tcps_sig_rcvbadsig); + return (0); + } + if (tcp_signature_compute(m, off0, tlen, optlen, &tmpdigest[0], + IPSEC_DIR_INBOUND) == -1) { + TCPSTAT_INC(tcps_sig_err_buildsig); + TCPSTAT_INC(tcps_sig_rcvbadsig); + return (0); + } + + if (bcmp(to->to_signature, &tmpdigest[0], TCP_SIGLEN) != 0) { + TCPSTAT_INC(tcps_sig_rcvbadsig); + return (0); + } + TCPSTAT_INC(tcps_sig_rcvgoodsig); + return (1); +} #endif /* TCP_SIGNATURE */ static int Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Mon Apr 25 16:37:47 2011 (r221022) +++ head/sys/netinet/tcp_syncache.c Mon Apr 25 17:13:40 2011 (r221023) @@ -1010,7 +1010,8 @@ _syncache_add(struct in_conninfo *inc, s struct syncache_head *sch; struct mbuf *ipopts = NULL; u_int32_t flowtmp; - int win, sb_hiwat, ip_ttl, ip_tos, noopt; + u_int ltflags; + int win, sb_hiwat, ip_ttl, ip_tos; char *s; #ifdef INET6 int autoflowlabel = 0; @@ -1043,7 +1044,7 @@ _syncache_add(struct in_conninfo *inc, s ip_tos = inp->inp_ip_tos; win = sbspace(&so->so_rcv); sb_hiwat = so->so_rcv.sb_hiwat; - noopt = (tp->t_flags & TF_NOOPT); + ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); /* By the time we drop the lock these should no longer be used. */ so = NULL; @@ -1238,14 +1239,14 @@ _syncache_add(struct in_conninfo *inc, s * XXX: Currently we always record the option by default and will * attempt to use it in syncache_respond(). */ - if (to->to_flags & TOF_SIGNATURE) + if (to->to_flags & TOF_SIGNATURE || ltflags & TF_SIGNATURE) sc->sc_flags |= SCF_SIGNATURE; #endif if (to->to_flags & TOF_SACKPERM) sc->sc_flags |= SCF_SACK; if (to->to_flags & TOF_MSS) sc->sc_peer_mss = to->to_mss; /* peer mss may be zero */ - if (noopt) + if (ltflags & TF_NOOPT) sc->sc_flags |= SCF_NOOPT; if ((th->th_flags & (TH_ECE|TH_CWR)) && V_tcp_do_ecn) sc->sc_flags |= SCF_ECN; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Apr 25 16:37:47 2011 (r221022) +++ head/sys/netinet/tcp_var.h Mon Apr 25 17:13:40 2011 (r221023) @@ -485,6 +485,13 @@ struct tcpstat { u_long tcps_ecn_shs; /* ECN successful handshakes */ u_long tcps_ecn_rcwnd; /* # times ECN reduced the cwnd */ + /* TCP_SIGNATURE related stats */ + u_long tcps_sig_rcvgoodsig; /* Total matching signature received */ + u_long tcps_sig_rcvbadsig; /* Total bad signature received */ + u_long tcps_sig_err_buildsig; /* Mismatching signature received */ + u_long tcps_sig_err_sigopt; /* No signature expected by socket */ + u_long tcps_sig_err_nosigopt; /* No signature provided by segment */ + u_long _pad[12]; /* 6 UTO, 6 TBD */ }; @@ -684,6 +691,8 @@ int tcp_twrespond(struct tcptw *, int); void tcp_setpersist(struct tcpcb *); #ifdef TCP_SIGNATURE int tcp_signature_compute(struct mbuf *, int, int, int, u_char *, u_int); +int tcp_signature_verify(struct mbuf *, int, int, int, struct tcpopt *, + struct tcphdr *, u_int); #endif void tcp_slowtimo(void); struct tcptemp * From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 17:34:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E9711065674; Mon, 25 Apr 2011 17:34:42 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AF4DF8FC12; Mon, 25 Apr 2011 17:34:40 +0000 (UTC) Received: by bwz12 with SMTP id 12so2785549bwz.13 for ; Mon, 25 Apr 2011 10:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=HYPckpByzpxGvDjb1DzfJzo2eI0tkUI/Y0mhjvY54PY=; b=sGwDZdl+ToJFVEqb6mH5cGtd1rXoVue9V/O/3aP/TAKlhIQANUANn7Qzx7DP3tOose EypvLLTsu6mVgwyxIWIxVZB2KO9QKBpxhZINBQv/Z1bqjW67CtbAixNsKPokhjHVTkzA MRjQFn6fGvFY74LjmJ/6FmcN1wN6LJC24ANBs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=uqMEBb5pQRuL/0/amGlkaXquRPwId6k1dJ8+3djW6TkX7FASRXlCc7fGuBW0ET1Gn9 FmJ941d1J7Jvpxe1KztLmxScM/hejo2Tl2VGwqJBUgxsBnapfJ/G3mCLDtTO4msUVHbT jbOrf8ZOeAXVm/ya8HBkKsqJ2jvlaypRQ/tFQ= Received: by 10.204.19.65 with SMTP id z1mr3449988bka.202.1303752879669; Mon, 25 Apr 2011 10:34:39 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l1sm3382935bkl.1.2011.04.25.10.34.37 (version=SSLv3 cipher=OTHER); Mon, 25 Apr 2011 10:34:39 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB5B0A9.4030805@FreeBSD.org> Date: Mon, 25 Apr 2011 20:34:33 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Warner Losh References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> In-Reply-To: <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 17:34:42 -0000 Warner Losh wrote: > On Apr 25, 2011, at 10:29 AM, Alexander Motin wrote: >> Warner Losh wrote: >>> On Apr 25, 2011, at 7:45 AM, Pawel Jakub Dawidek wrote: >>>> On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: >>>>> I had been pondering devfs "link"s myself, the problem is that from the rc >>>>> framework they come too late. If you can add a simple .ko that does it >>>>> programmatically on 9 that would be great. The problem is that after booting >>>>> the new kernel you don't know whether people had ATA_STATIC on or not, so >>>>> we'd have to go with the defaults, that were in 8.x (and an extra tunable to >>>>> flip the logic maybe)? >>>> We do know that people have ATA_STATIC_ID, because if they don't, this >>>> means they have their custom kernel config which doesn't contain ATA_CAM >>>> and when they will use it next time they recompile their kernel they >>>> will still have /dev/adX entries. >>>> >>>> Also, as Alexander already noted, because of all the problems with ATA >>>> naming over the years and for other reasons too, people often hardcode >>>> provider name in various GEOM classes metadata, so symlink won't help. >>> Do we have a short list of the places to look? >> Quick man pages grepping shows that at least gmirror, gstripe, graid3, >> gjournal, gvirstor, gconcat, gshsec support provider names hardcoding. >> For gmirror and graid3 present status can be obtained by: `gXXX list | >> egrep "Flags: .*HARDCODED"`. For gvirstor, gshsec, gstripe and gconcat: >> `gXXX dump adX | egrep "Hardcoded provider: ad"`. For gjournal: >> `gjournal dump adX | egrep "hcprovider: ad"`. > > That wouldn't be too horrible... > >>> A lot of this could be done with a script that gets run at installworld and boot time to hunt down the old cases and report them to the user before they upgrade their kernel (but this would mean backing out the GENERIC change for a while to give people a chance to upgrade to label-based provisioning... >> If I understand idea right, independently of how much we delay it, there >> will be some people who not updated during that window to get in code >> detecting it during boot. Hardly many people of target auditory updating >> their systems each month. Same time some checks indeed could be done in >> installkernel. > > We'd have to delay it at least a month, if not more. However, the time to have done these checks were 8.1ish rather than 9.0 nearing code-freezeish. I'd thought there was going to be better compatibility last year at this time, or I'd have pushed this idea harder in the community... > > And yes, I'd envisioned installkernel also doing these checks, just to be complete and prevent foot-shooting. At this point, it's all we have. For the 9.0 install, we'll likely need to do a subset of this as people import their gmirrors created with 8.x... I've thought about the process of fixing hardcoded provider names there, and it is absolutely not trivial. If we take the "symlinking" way (patch is already posted to current@), I think it will be much easier for everybody, and especially users, if I hack all mentioned above GEOM classes to ignore adX/adaY difference in provider names. And it should perfectly fit into remaining time window. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 17:49:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C43106566B; Mon, 25 Apr 2011 17:49:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id A159B8FC0A; Mon, 25 Apr 2011 17:49:37 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3923C46B06; Mon, 25 Apr 2011 13:49:37 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B1D158A027; Mon, 25 Apr 2011 13:49:36 -0400 (EDT) From: John Baldwin To: Alexander Motin Date: Mon, 25 Apr 2011 13:23:36 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB47CD4.9060300@FreeBSD.org> In-Reply-To: <4DB47CD4.9060300@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201104251323.36510.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 25 Apr 2011 13:49:36 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 17:49:37 -0000 On Sunday, April 24, 2011 3:41:08 pm Alexander Motin wrote: > On 24.04.2011 21:59, Bjoern A. Zeeb wrote: > >> What's about creating some kind of symlinks, it could be nice if it > >> worked, but I don't see the way to do it on disk(9) or GEOM layers > >> without breaking device's access counters and as result further random > >> problems. > > > > I had been pondering devfs "link"s myself, the problem is that from the rc > > framework they come too late. If you can add a simple .ko that does it > > programmatically on 9 that would be great. The problem is that after booting > > the new kernel you don't know whether people had ATA_STATIC on or not, so > > we'd have to go with the defaults, that were in 8.x (and an extra tunable to > > flip the logic maybe)? > > Devfs links won't help users with hardcoded provider names in gmirror, > etc -- from GEOM PoV there will be no such providers. Also to create > proper mapping that module should have real-time information from CAM > about ATA controller details. And looking that it will have to link in > real time any derivative providers also (ad4s1a -> ada0s1a) I worry if > it is possible at all. Some devfs expert needed here. I think the biggest goal is to make /etc/fstab migration easiest. I wonder if you could leverage the device cloning callback in devfs to create symlinks on the fly as name lookups were done (so if mount tries to use /dev/ad4 from /etc/fstab the symlink would be created on the fly). This would allow you to handle arbitrary suffixes (i.e. just make sure it matches 'adX(.*)' and generate 'adaY\1' as the link target) without having to modify any of gpart, etc. to create a forest of symlinks. The only possible issue with this is that the devfs cloning eventhandler wants you to return a dev_t, not a symlink. That might still work fine (you might have to do a namei() lookup to find the adaX.* devfs entry), but then you would not get /dev/adX.* entries listed in /dev when you did an ls. Instead, trying to open those old names would just transparently "work". You could maybe print a message on the console warning that you were remapping an old name to a new one. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 18:15:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B27A106566B; Mon, 25 Apr 2011 18:15:45 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 793AF8FC15; Mon, 25 Apr 2011 18:15:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PIFjT8086927; Mon, 25 Apr 2011 18:15:45 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PIFj0s086925; Mon, 25 Apr 2011 18:15:45 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201104251815.p3PIFj0s086925@svn.freebsd.org> From: Olivier Houchard Date: Mon, 25 Apr 2011 18:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221025 - head/sys/arm/at91 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 18:15:45 -0000 Author: cognet Date: Mon Apr 25 18:15:45 2011 New Revision: 221025 URL: http://svn.freebsd.org/changeset/base/221025 Log: Typo fix Modified: head/sys/arm/at91/at91_wdt.c Modified: head/sys/arm/at91/at91_wdt.c ============================================================================== --- head/sys/arm/at91/at91_wdt.c Mon Apr 25 17:34:10 2011 (r221024) +++ head/sys/arm/at91/at91_wdt.c Mon Apr 25 18:15:45 2011 (r221025) @@ -102,7 +102,7 @@ wdt_watchdog(void *argp, u_int cmd, int else if (interval > 0) sc->cmd = interval | WD_ACTIVE; - /* We cannot turn of our watchdog so if user + /* We cannot turn off our watchdog so if user * fails to turn us on go to passive mode. */ if ((sc->cmd & WD_ACTIVE) == 0) sc->cmd = WD_PASSIVE; From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 18:35:47 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4830E106566B; Mon, 25 Apr 2011 18:35:47 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id A1AB98FC08; Mon, 25 Apr 2011 18:35:46 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id p3PIZkeF007091; Mon, 25 Apr 2011 11:35:46 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id p3PIZkr5007090; Mon, 25 Apr 2011 11:35:46 -0700 (PDT) (envelope-from obrien) Date: Mon, 25 Apr 2011 11:35:46 -0700 From: "David O'Brien" To: Alexander Motin Message-ID: <20110425183546.GA6188@dragon.NUXI.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104240858.p3O8wwqT024628@svn.freebsd.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? X-Mutt-References: <201104240858.p3O8wwqT024628@svn.freebsd.org> X-Mutt-Fcc: =sent User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 18:35:47 -0000 On Sun, Apr 24, 2011 at 08:58:58AM +0000, Alexander Motin wrote: > Log: > Switch the GENERIC kernels for all architectures to the new CAM-based ATA > stack. It means that all legacy ATA drivers are disabled and replaced by > respective CAM drivers. If you are using ATA device names in /etc/fstab or > other places, make sure to update them respectively (adX -> adaY, > acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential > numbers for each type in order of detection, unless configured otherwise > with tunables, see cam(4)). I apologize if I missed a past discussion... but wasn't CAM designed so that all disk-like things would be 'da' (direct access) irregardless of underling protocol (SCSI/SAS/PATA/SATA)? "afdX -> daY" above helps suggest this. Wasn't that the reason we moved from 'sd' to 'da'? At least this was the impression on freebsd-current@ back when we when thru this in 1999 (e.g., <36EFF7C2.41C67EA6@whistle.com>, <4714.920569143@verdi.nethelp.no>, <29382.921672594@verdi.nethelp.no>, <199903172035.PAA07013@khavrinen.lcs.mit.edu>). Now ATA-CAM is the default, why aren't disks devices named by the established CAM names? If we're not going to call CAM controlled ATA disks "da", then why not keep the existing "ad" and "ar" given "ad" stood for "ATA-Disk" and "ATA-RAID" -- you're still calling the subsystem "ata". Otherwise, we can just recycle email from 1999 where folks didn't see much value in the sd->da change. -- -- David (obrien@FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 19:15:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A01A81065675; Mon, 25 Apr 2011 19:15:58 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9D78FC13; Mon, 25 Apr 2011 19:15:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PJFwJ7088706; Mon, 25 Apr 2011 19:15:58 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PJFwZ7088704; Mon, 25 Apr 2011 19:15:58 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201104251915.p3PJFwZ7088704@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Apr 2011 19:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221026 - head/usr.bin/printf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 19:15:58 -0000 Author: jilles Date: Mon Apr 25 19:15:58 2011 New Revision: 221026 URL: http://svn.freebsd.org/changeset/base/221026 Log: printf(1): Move non-bugs from the BUGS section to a new section CAVEATS. Modified: head/usr.bin/printf/printf.1 Modified: head/usr.bin/printf/printf.1 ============================================================================== --- head/usr.bin/printf/printf.1 Mon Apr 25 18:15:45 2011 (r221025) +++ head/usr.bin/printf/printf.1 Mon Apr 25 19:15:58 2011 (r221026) @@ -337,6 +337,16 @@ command appeared in It is modeled after the standard library function, .Xr printf 3 . +.Sh CAVEATS +.Tn ANSI +hexadecimal character constants were deliberately not provided. +.Pp +Trying to print a dash ("-") as the first character causes +.Nm +to interpret the dash as a program argument. +.Nm -- +must be used before +.Ar format . .Sh BUGS Since the floating point numbers are translated from .Tn ASCII @@ -348,9 +358,6 @@ The .Cm L modifier may produce additional precision, depending on the hardware platform.) .Pp -.Tn ANSI -hexadecimal character constants were deliberately not provided. -.Pp The escape sequence \e000 is the string terminator. When present in the argument for the .Cm b @@ -360,10 +367,3 @@ Multibyte characters are not recognized a problem if .Ql % can appear inside a multibyte character). -.Pp -Trying to print a dash ("-") as the first character causes -.Nm -to interpet the dash as a program argument. -.Nm -- -must be used before -.Ar format . From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 19:16:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0F951065670; Mon, 25 Apr 2011 19:16:37 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 43E818FC14; Mon, 25 Apr 2011 19:16:37 +0000 (UTC) Received: by pwj8 with SMTP id 8so1752716pwj.13 for ; Mon, 25 Apr 2011 12:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:references:in-reply-to:mime-version :content-transfer-encoding:content-type:message-id:cc:x-mailer:from :subject:date:to; bh=14eX7lr2Gjz4DDYr6VnS3uFqoxq4CXGGfgn/VDAAdFc=; b=dvustF1/4GcYxAekDjWxDHE02MJFia6qG7nKgcvzmWPciln5iWg7pGn+iTfjSq1F4Q aS//eF4FN8lK5YeVaqZ0W6T3sxQVXwj+cct2eLYB5cR3oXisCpJVvcIu8qKUV66JaqPG FzHaZm8j7DhEe3PODSB03Oc8vLZZ1AdxkT6bc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; b=UCqT4Vk75C9whk7CvAegepdIRycUT5WpriIi6zGTLBlZ4u61/LR3RZcv2JVtAIyMOS GhdzfDzKDPWa12CgHAB3svpFw//UlX49iOTO2Ll7061PSdr13r5YRDF03yi3mR6iXLOJ 5t3ORb0sOthBmLOIZXjGUUc+T3ED+wlyH2768= Received: by 10.142.151.4 with SMTP id y4mr2927244wfd.133.1303758996950; Mon, 25 Apr 2011 12:16:36 -0700 (PDT) Received: from [10.64.171.124] ([166.205.143.68]) by mx.google.com with ESMTPS id w14sm7257579wfh.8.2011.04.25.12.16.31 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Apr 2011 12:16:35 -0700 (PDT) References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> In-Reply-To: <4DB5A166.9010302@FreeBSD.org> Mime-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <11B524F2-70D6-4B8A-BC7C-005EB5D6E393@gmail.com> X-Mailer: iPhone Mail (8C148) From: Garrett Cooper Date: Mon, 25 Apr 2011 12:16:22 -0700 To: Alexander Motin Cc: "src-committers@FreeBSD.org" , Pawel Jakub Dawidek , "svn-src-all@FreeBSD.org" , "Bjoern A. Zeeb" , Robert Watson , "svn-src-head@FreeBSD.org" , Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 19:16:38 -0000 On Apr 25, 2011, at 9:29 AM, Alexander Motin wrote: > Warner Losh wrote: >> On Apr 25, 2011, at 7:45 AM, Pawel Jakub Dawidek wrote: >>> On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: >>>> I had been pondering devfs "link"s myself, the problem is that from the= rc >>>> framework they come too late. If you can add a simple .ko that does it= >>>> programmatically on 9 that would be great. The problem is that after b= ooting >>>> the new kernel you don't know whether people had ATA_STATIC on or not, s= o >>>> we'd have to go with the defaults, that were in 8.x (and an extra tunab= le to >>>> flip the logic maybe)? >>> We do know that people have ATA_STATIC_ID, because if they don't, this >>> means they have their custom kernel config which doesn't contain ATA_CAM= >>> and when they will use it next time they recompile their kernel they >>> will still have /dev/adX entries. >>>=20 >>> Also, as Alexander already noted, because of all the problems with ATA >>> naming over the years and for other reasons too, people often hardcode >>> provider name in various GEOM classes metadata, so symlink won't help. >>=20 >> Do we have a short list of the places to look?=20 >=20 > Quick man pages grepping shows that at least gmirror, gstripe, graid3, > gjournal, gvirstor, gconcat, gshsec support provider names hardcoding. > For gmirror and graid3 present status can be obtained by: `gXXX list | > egrep "Flags: .*HARDCODED"`. For gvirstor, gshsec, gstripe and gconcat: > `gXXX dump adX | egrep "Hardcoded provider: ad"`. For gjournal: > `gjournal dump adX | egrep "hcprovider: ad"`. >=20 >> A lot of this could be done with a script that gets run at installworld a= nd boot time to hunt down the old cases and report them to the user before t= hey upgrade their kernel (but this would mean backing out the GENERIC change= for a while to give people a chance to upgrade to label-based provisioning.= .. >=20 > If I understand idea right, independently of how much we delay it, there > will be some people who not updated during that window to get in code > detecting it during boot. Hardly many people of target auditory updating > their systems each month. Same time some checks indeed could be done in > installkernel. For people like me who install multiple kernels and boot them at will, espec= ially when there are other features under a large degree of development, thi= s kind of action isn't acceptable because it shoots you in the foot when mov= ing between the different kernels. I'd prefer having an UPDATING note with all of the affected areas so that pe= ople can understand what needs to change and adjust their systems accordingl= y. As far as geom based hardcoding is concerned: maybe this can serve as a g= ood lesson of what shouldn't be done and what should be fixed/have a transla= tion layer added for this item? Thanks, -Garrett= From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 19:23:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 593CB106566C; Mon, 25 Apr 2011 19:23:07 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4F92B8FC13; Mon, 25 Apr 2011 19:23:05 +0000 (UTC) Received: by bwz12 with SMTP id 12so2897960bwz.13 for ; Mon, 25 Apr 2011 12:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=V0bPMybhXpr0UBlWcTvuK5+VjaAzr+3+BI4YhmuBfsE=; b=v/eGL62D9wuzdZZgSlDpTvlvUJpWMXTT93Qom9LMVRI5C9tHKx6jL6PK303/ptWwci H8xI9RignomElZBxFjlBhCg2ulz/l0TwA5Sw4vxAu7MgGxSU3zKE9Q3IY3+WcT6hvi2n Zw1f3aEhgYGVfP+lOIdghYuLMS2sTEkbx7knE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=CmSbbn+OCCl9YPiikwVZ2vi7rX2F4k+YnXHc3QKpljnd6dYyJQLYdCVQf7TLun68aA +xhmhvVeZw+n2tDwaa8TatxMzGUoc0sXAzgCCeXYFyQb5Ajd6OxHmJsTkVuhedFbbx/Z mzh+CrHJSPpxl0z+CE3Ih+YWMGF/B8WfG5ZHc= Received: by 10.204.49.87 with SMTP id u23mr3734330bkf.171.1303759385067; Mon, 25 Apr 2011 12:23:05 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id 16sm3428414bkm.6.2011.04.25.12.23.03 (version=SSLv3 cipher=OTHER); Mon, 25 Apr 2011 12:23:04 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB5CA13.8040305@FreeBSD.org> Date: Mon, 25 Apr 2011 22:22:59 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: obrien@FreeBSD.org References: <20110425183546.GA6188@dragon.NUXI.org> In-Reply-To: <20110425183546.GA6188@dragon.NUXI.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 19:23:07 -0000 David O'Brien wrote: > On Sun, Apr 24, 2011 at 08:58:58AM +0000, Alexander Motin wrote: >> Log: >> Switch the GENERIC kernels for all architectures to the new CAM-based ATA >> stack. It means that all legacy ATA drivers are disabled and replaced by >> respective CAM drivers. If you are using ATA device names in /etc/fstab or >> other places, make sure to update them respectively (adX -> adaY, >> acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential >> numbers for each type in order of detection, unless configured otherwise >> with tunables, see cam(4)). > > I apologize if I missed a past discussion... but wasn't CAM designed > so that all disk-like things would be 'da' (direct access) irregardless > of underling protocol (SCSI/SAS/PATA/SATA)? "afdX -> daY" above helps > suggest this. Wasn't that the reason we moved from 'sd' to 'da'? > At least this was the impression on freebsd-current@ back when we when > thru this in 1999 (e.g., <36EFF7C2.41C67EA6@whistle.com>, > <4714.920569143@verdi.nethelp.no>, <29382.921672594@verdi.nethelp.no>, > <199903172035.PAA07013@khavrinen.lcs.mit.edu>). CAM unifies the way to execute commands on devices with different transports. That is why after this change afdX become daY and acdX become cdY -- they all use SCSI command set. adaX same time stays on it's own because it is ATA and uses different peripheral driver. It was one of options to go by emulation way, translating SCSI commands into ATA. That would turned all direct access devices into SCSI and daX, but we went other way to not implement additional state machines for this translation, since existing ata(4) state machine was horrible and we prefer to drop it completely. > Now ATA-CAM is the default, why aren't disks devices named by the > established CAM names? > > If we're not going to call CAM controlled ATA disks "da", then why not > keep the existing "ad" and "ar" given "ad" stood for "ATA-Disk" and > "ATA-RAID" -- you're still calling the subsystem "ata". What's about ad and ada, there is about 18 month history of early adopting this new ATA stack. Using same name initially wasn't possible due to collisions old stack, change now -- due to many adopted systems. What's about ar, it is not so principal to me. With new names I was trying to mimic other GEOMs behavior. But if people decide otherwise, I see no problem to change it now. > Otherwise, we can just recycle email from 1999 where folks didn't > see much value in the sd->da change. Sorry, I wasn't there in 1990s to speak about that change. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 20:25:08 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 277441065676; Mon, 25 Apr 2011 20:25:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id CA3418FC1D; Mon, 25 Apr 2011 20:25:07 +0000 (UTC) Received: from [10.30.101.54] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3PKKD11023681 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Mon, 25 Apr 2011 14:20:14 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <11B524F2-70D6-4B8A-BC7C-005EB5D6E393@gmail.com> Date: Mon, 25 Apr 2011 14:20:08 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <11B524F2-70D6-4B8A-BC7C-005EB5D6E393@gmail.com> To: Garrett Cooper X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Mon, 25 Apr 2011 14:20:15 -0600 (MDT) Cc: "src-committers@FreeBSD.org" , Pawel Jakub Dawidek , Alexander Motin , "Bjoern A. Zeeb" , Robert Watson , "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 20:25:08 -0000 On Apr 25, 2011, at 1:16 PM, Garrett Cooper wrote: > On Apr 25, 2011, at 9:29 AM, Alexander Motin wrote: >=20 >> Warner Losh wrote: >>> On Apr 25, 2011, at 7:45 AM, Pawel Jakub Dawidek wrote: >>>> On Sun, Apr 24, 2011 at 06:59:40PM +0000, Bjoern A. Zeeb wrote: >>>>> I had been pondering devfs "link"s myself, the problem is that = from the rc >>>>> framework they come too late. If you can add a simple .ko that = does it >>>>> programmatically on 9 that would be great. The problem is that = after booting >>>>> the new kernel you don't know whether people had ATA_STATIC on or = not, so >>>>> we'd have to go with the defaults, that were in 8.x (and an extra = tunable to >>>>> flip the logic maybe)? >>>> We do know that people have ATA_STATIC_ID, because if they don't, = this >>>> means they have their custom kernel config which doesn't contain = ATA_CAM >>>> and when they will use it next time they recompile their kernel = they >>>> will still have /dev/adX entries. >>>>=20 >>>> Also, as Alexander already noted, because of all the problems with = ATA >>>> naming over the years and for other reasons too, people often = hardcode >>>> provider name in various GEOM classes metadata, so symlink won't = help. >>>=20 >>> Do we have a short list of the places to look?=20 >>=20 >> Quick man pages grepping shows that at least gmirror, gstripe, = graid3, >> gjournal, gvirstor, gconcat, gshsec support provider names = hardcoding. >> For gmirror and graid3 present status can be obtained by: `gXXX list = | >> egrep "Flags: .*HARDCODED"`. For gvirstor, gshsec, gstripe and = gconcat: >> `gXXX dump adX | egrep "Hardcoded provider: ad"`. For gjournal: >> `gjournal dump adX | egrep "hcprovider: ad"`. >>=20 >>> A lot of this could be done with a script that gets run at = installworld and boot time to hunt down the old cases and report them to = the user before they upgrade their kernel (but this would mean backing = out the GENERIC change for a while to give people a chance to upgrade to = label-based provisioning... >>=20 >> If I understand idea right, independently of how much we delay it, = there >> will be some people who not updated during that window to get in code >> detecting it during boot. Hardly many people of target auditory = updating >> their systems each month. Same time some checks indeed could be done = in >> installkernel. >=20 > For people like me who install multiple kernels and boot them at will, = especially when there are other features under a large degree of = development, this kind of action isn't acceptable because it shoots you = in the foot when moving between the different kernels. No it doesn't. (a) There will be an override flag, if you really don't want to. = WITHOUT_FSCK_SANITY_CHECK=3Dt and we're done. (b) The /dev/ufsid/*,/dev/gpt/*, /dev/ufs/* naming works on both flavors = of kernel. > I'd prefer having an UPDATING note with all of the affected areas so = that people can understand what needs to change and adjust their systems = accordingly. As far as geom based hardcoding is concerned: maybe this = can serve as a good lesson of what shouldn't be done and what should be = fixed/have a translation layer added for this item? I'd prefer having it be there also. Warner > Thanks, > -Garrett >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 20:54:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC1F81065673; Mon, 25 Apr 2011 20:54:12 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E91E8FC18; Mon, 25 Apr 2011 20:54:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PKsC6t091926; Mon, 25 Apr 2011 20:54:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PKsCaN091921; Mon, 25 Apr 2011 20:54:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201104252054.p3PKsCaN091921@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 25 Apr 2011 20:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221027 - in head: bin/sh tools/regression/bin/sh/execution X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 20:54:12 -0000 Author: jilles Date: Mon Apr 25 20:54:12 2011 New Revision: 221027 URL: http://svn.freebsd.org/changeset/base/221027 Log: sh: Set $? to 0 for background commands. For backgrounded pipelines and subshells, the previous value of $? was being preserved, which is incorrect. For backgrounded simple commands containing a command substitution, the status of the last command substitution was returned instead of 0. If fork() fails, this is an error. Added: head/tools/regression/bin/sh/execution/bg1.0 (contents, props changed) head/tools/regression/bin/sh/execution/bg2.0 (contents, props changed) head/tools/regression/bin/sh/execution/bg3.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Mon Apr 25 19:15:58 2011 (r221026) +++ head/bin/sh/eval.c Mon Apr 25 20:54:12 2011 (r221027) @@ -420,7 +420,8 @@ evalsubshell(union node *n, int flags) INTOFF; exitstatus = waitforjob(jp, (int *)NULL); INTON; - } + } else + exitstatus = 0; } @@ -559,7 +560,8 @@ evalpipe(union node *n) exitstatus = waitforjob(jp, (int *)NULL); TRACE(("evalpipe: job done exit status %d\n", exitstatus)); INTON; - } + } else + exitstatus = 0; } @@ -1056,7 +1058,8 @@ parent: /* parent process gets here (if backcmd->fd = pip[0]; close(pip[1]); backcmd->jp = jp; - } + } else + exitstatus = 0; out: if (lastarg) Added: head/tools/regression/bin/sh/execution/bg1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/bg1.0 Mon Apr 25 20:54:12 2011 (r221027) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +: `false` & Added: head/tools/regression/bin/sh/execution/bg2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/bg2.0 Mon Apr 25 20:54:12 2011 (r221027) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 42; } +f +: | : & Added: head/tools/regression/bin/sh/execution/bg3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/execution/bg3.0 Mon Apr 25 20:54:12 2011 (r221027) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 42; } +f +(:) & From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 21:53:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57DBE106564A; Mon, 25 Apr 2011 21:53:42 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4639E8FC16; Mon, 25 Apr 2011 21:53:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PLrgQ2093852; Mon, 25 Apr 2011 21:53:42 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PLrgkW093850; Mon, 25 Apr 2011 21:53:42 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201104252153.p3PLrgkW093850@svn.freebsd.org> From: David Christensen Date: Mon, 25 Apr 2011 21:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221030 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 21:53:42 -0000 Author: davidch Date: Mon Apr 25 21:53:41 2011 New Revision: 221030 URL: http://svn.freebsd.org/changeset/base/221030 Log: - Added bxe(4) driver for i386 and amd64. Currently untested on other CPU architectures. MFC after: One week Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Apr 25 21:27:38 2011 (r221029) +++ head/sys/modules/Makefile Mon Apr 25 21:53:41 2011 (r221030) @@ -40,6 +40,8 @@ SUBDIR= ${_3dfx} \ bce \ bfe \ bge \ + ${_bxe} \ + ${_bxe} \ ${_bios} \ ${_bktr} \ ${_bm} \ @@ -383,6 +385,7 @@ _aout= aout _apm= apm _arcnet= arcnet _bktr= bktr +_bxe= bxe _cardbus= cardbus _cbb= cbb _ce= ce @@ -529,6 +532,7 @@ _amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc +_bxe= bxe _cardbus= cardbus _cbb= cbb _cmx= cmx From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 22:00:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94A311065670; Mon, 25 Apr 2011 22:00:23 +0000 (UTC) (envelope-from davidch@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68B6D8FC0A; Mon, 25 Apr 2011 22:00:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PM0NU2094125; Mon, 25 Apr 2011 22:00:23 GMT (envelope-from davidch@svn.freebsd.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PM0NiG094123; Mon, 25 Apr 2011 22:00:23 GMT (envelope-from davidch@svn.freebsd.org) Message-Id: <201104252200.p3PM0NiG094123@svn.freebsd.org> From: David Christensen Date: Mon, 25 Apr 2011 22:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221031 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 22:00:23 -0000 Author: davidch Date: Mon Apr 25 22:00:23 2011 New Revision: 221031 URL: http://svn.freebsd.org/changeset/base/221031 Log: - Removed duplicate {_bxe} definition. MFC after: One week Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Apr 25 21:53:41 2011 (r221030) +++ head/sys/modules/Makefile Mon Apr 25 22:00:23 2011 (r221031) @@ -41,7 +41,6 @@ SUBDIR= ${_3dfx} \ bfe \ bge \ ${_bxe} \ - ${_bxe} \ ${_bios} \ ${_bktr} \ ${_bm} \ From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 22:22:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA203106566B; Mon, 25 Apr 2011 22:22:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D633B8FC1B; Mon, 25 Apr 2011 22:22:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PMMpxJ094882; Mon, 25 Apr 2011 22:22:51 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PMMpJe094870; Mon, 25 Apr 2011 22:22:51 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104252222.p3PMMpJe094870@svn.freebsd.org> From: Rick Macklem Date: Mon, 25 Apr 2011 22:22:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221032 - in head/sys: amd64/amd64 conf i386/i386 modules/nfscl modules/nfsclient nfs nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 22:22:52 -0000 Author: rmacklem Date: Mon Apr 25 22:22:51 2011 New Revision: 221032 URL: http://svn.freebsd.org/changeset/base/221032 Log: Fix the experimental NFS client so that it does not bogusly set the f_flags field of "struct statfs". This had the interesting effect of making the NFSv4 mounts "disappear" after r221014, since NFSMNT_NFSV4 and MNT_IGNORE became the same bit. Move the files used for a diskless NFS root from sys/nfsclient to sys/nfs in preparation for them to be used by both NFS clients. Also, move the declaration of the three global data structures from sys/nfsclient/nfs_vfsops.c to sys/nfs/nfs_diskless.c so that they are defined when either client uses them. Reviewed by: jhb MFC after: 2 weeks Added: head/sys/nfs/bootp_subr.c - copied, changed from r221031, head/sys/nfsclient/bootp_subr.c head/sys/nfs/krpc.h - copied unchanged from r221031, head/sys/nfsclient/krpc.h head/sys/nfs/krpc_subr.c - copied, changed from r221031, head/sys/nfsclient/krpc_subr.c head/sys/nfs/nfs_diskless.c - copied, changed from r221031, head/sys/nfsclient/nfs_diskless.c head/sys/nfs/nfsdiskless.h - copied unchanged from r221031, head/sys/nfsclient/nfsdiskless.h Deleted: head/sys/nfsclient/bootp_subr.c head/sys/nfsclient/krpc.h head/sys/nfsclient/krpc_subr.c head/sys/nfsclient/nfs_diskless.c head/sys/nfsclient/nfsdiskless.h Modified: head/sys/amd64/amd64/genassym.c head/sys/conf/files head/sys/i386/i386/genassym.c head/sys/modules/nfscl/Makefile head/sys/modules/nfsclient/Makefile head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Apr 25 22:00:23 2011 (r221031) +++ head/sys/amd64/amd64/genassym.c Mon Apr 25 22:22:51 2011 (r221032) @@ -65,7 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Apr 25 22:00:23 2011 (r221031) +++ head/sys/conf/files Mon Apr 25 22:22:51 2011 (r221032) @@ -2822,12 +2822,12 @@ netsmb/smb_smb.c optional netsmb netsmb/smb_subr.c optional netsmb netsmb/smb_trantcp.c optional netsmb netsmb/smb_usr.c optional netsmb +nfs/bootp_subr.c optional bootp nfsclient | bootp nfscl +nfs/krpc_subr.c optional bootp nfsclient | bootp nfscl nfs/nfs_common.c optional nfsclient | nfsserver +nfs/nfs_diskless.c optional nfsclient nfs_root | nfscl nfs_root nfs/nfs_lock.c optional nfsclient | nfscl | nfslockd | nfsd -nfsclient/bootp_subr.c optional bootp nfsclient -nfsclient/krpc_subr.c optional bootp nfsclient nfsclient/nfs_bio.c optional nfsclient -nfsclient/nfs_diskless.c optional nfsclient nfs_root nfsclient/nfs_node.c optional nfsclient nfsclient/nfs_krpc.c optional nfsclient nfsclient/nfs_subs.c optional nfsclient Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Mon Apr 25 22:00:23 2011 (r221031) +++ head/sys/i386/i386/genassym.c Mon Apr 25 22:22:51 2011 (r221032) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifdef DEV_APIC #include #endif Modified: head/sys/modules/nfscl/Makefile ============================================================================== --- head/sys/modules/nfscl/Makefile Mon Apr 25 22:00:23 2011 (r221031) +++ head/sys/modules/nfscl/Makefile Mon Apr 25 22:22:51 2011 (r221032) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../fs/nfsclient +.PATH: ${.CURDIR}/../../fs/nfsclient ${.CURDIR}/../../nfs KMOD= nfscl SRCS= vnode_if.h \ nfs_clrpcops.c \ @@ -22,4 +22,36 @@ SRCS= vnode_if.h \ opt_ufs.h \ opt_kgssapi.h +.if !defined(KERNBUILDDIR) +NFS_INET?= 1 # 0/1 - requires INET to be configured in kernel +NFS_INET6?= 1 # 0/1 - requires INET6 to be configured in kernel +NFS_ROOT?= 1 # 0/1 - requires NFS_ROOT to be configured in kernel + +.if ${NFS_INET} > 0 +opt_inet.h: + echo "#define INET 1" > ${.TARGET} +.endif + +.if ${NFS_INET6} > 0 +opt_inet6.h: + echo "#define INET6 1" > ${.TARGET} +.endif + +.if ${NFS_ROOT} > 0 +opt_nfsroot.h: + echo "#define NFS_ROOT 1" > ${.TARGET} +.endif +.else +OPT_NFS_ROOT!= cat ${KERNBUILDDIR}/opt_nfsroot.h +.if empty(OPT_NFS_ROOT) +NFS_ROOT= 0 +.else +NFS_ROOT= 1 +.endif +.endif + +.if ${NFS_ROOT} > 0 +SRCS+= nfs_diskless.c +.endif + .include Modified: head/sys/modules/nfsclient/Makefile ============================================================================== --- head/sys/modules/nfsclient/Makefile Mon Apr 25 22:00:23 2011 (r221031) +++ head/sys/modules/nfsclient/Makefile Mon Apr 25 22:22:51 2011 (r221032) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../nfsclient ${.CURDIR}/../../rpc +.PATH: ${.CURDIR}/../../nfsclient ${.CURDIR}/../../nfs ${.CURDIR}/../../rpc KMOD= nfsclient SRCS= vnode_if.h \ Copied and modified: head/sys/nfs/bootp_subr.c (from r221031, head/sys/nfsclient/bootp_subr.c) ============================================================================== --- head/sys/nfsclient/bootp_subr.c Mon Apr 25 22:00:23 2011 (r221031, copy source) +++ head/sys/nfs/bootp_subr.c Mon Apr 25 22:22:51 2011 (r221032) @@ -69,8 +69,8 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include +#include #include Copied: head/sys/nfs/krpc.h (from r221031, head/sys/nfsclient/krpc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/nfs/krpc.h Mon Apr 25 22:22:51 2011 (r221032, copy of r221031, head/sys/nfsclient/krpc.h) @@ -0,0 +1,31 @@ +/* $NetBSD: krpc.h,v 1.4 1995/12/19 23:07:11 cgd Exp $ */ +/* $FreeBSD$ */ + +#include + +struct mbuf; +struct thread; +struct sockaddr; +struct sockaddr_in; + +int krpc_call(struct sockaddr_in *_sin, + u_int prog, u_int vers, u_int func, + struct mbuf **data, struct sockaddr **from, struct thread *td); + +int krpc_portmap(struct sockaddr_in *_sin, + u_int prog, u_int vers, u_int16_t *portp, struct thread *td); + +struct mbuf *xdr_string_encode(char *str, int len); + +/* + * RPC definitions for the portmapper + */ +#define PMAPPORT 111 +#define PMAPPROG 100000 +#define PMAPVERS 2 +#define PMAPPROC_NULL 0 +#define PMAPPROC_SET 1 +#define PMAPPROC_UNSET 2 +#define PMAPPROC_GETPORT 3 +#define PMAPPROC_DUMP 4 +#define PMAPPROC_CALLIT 5 Copied and modified: head/sys/nfs/krpc_subr.c (from r221031, head/sys/nfsclient/krpc_subr.c) ============================================================================== --- head/sys/nfsclient/krpc_subr.c Mon Apr 25 22:00:23 2011 (r221031, copy source) +++ head/sys/nfs/krpc_subr.c Mon Apr 25 22:22:51 2011 (r221032) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include /* Copied and modified: head/sys/nfs/nfs_diskless.c (from r221031, head/sys/nfsclient/nfs_diskless.c) ============================================================================== --- head/sys/nfsclient/nfs_diskless.c Mon Apr 25 22:00:23 2011 (r221031, copy source) +++ head/sys/nfs/nfs_diskless.c Mon Apr 25 22:22:51 2011 (r221032) @@ -55,13 +55,22 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include static int inaddr_to_sockaddr(char *ev, struct sockaddr_in *sa); static int hwaddr_to_sockaddr(char *ev, struct sockaddr_dl *sa); static int decode_nfshandle(char *ev, u_char *fh, int maxfh); /* + * This structure must be filled in by a primary bootstrap or bootstrap + * server for a diskless/dataless machine. It is initialized below just + * to ensure that it is allocated to initialized data (.data not .bss). + */ +struct nfs_diskless nfs_diskless = { { { 0 } } }; +struct nfsv3_diskless nfsv3_diskless = { { { 0 } } }; +int nfs_diskless_valid = 0; + +/* * Validate/sanity check a rsize/wsize parameter. */ static int Copied: head/sys/nfs/nfsdiskless.h (from r221031, head/sys/nfsclient/nfsdiskless.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/nfs/nfsdiskless.h Mon Apr 25 22:22:51 2011 (r221032, copy of r221031, head/sys/nfsclient/nfsdiskless.h) @@ -0,0 +1,114 @@ +/*- + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Rick Macklem at The University of Guelph. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)nfsdiskless.h 8.2 (Berkeley) 3/30/95 + * $FreeBSD$ + */ + +#ifndef _NFSCLIENT_NFSDISKLESS_H_ +#define _NFSCLIENT_NFSDISKLESS_H_ + +/* + * Structure that must be initialized for a diskless nfs client. + * This structure is used by nfs_mountroot() to set up the root vnode, + * and to do a partial ifconfig(8) and route(8) so that the critical net + * interface can communicate with the server. + * The primary bootstrap is expected to fill in the appropriate fields before + * starting the kernel. + * Currently only works for AF_INET protocols. + * NB: All fields are stored in net byte order to avoid hassles with + * client/server byte ordering differences. + */ + +/* + * I have defined a new structure that can handle an NFS Version 3 file handle + * but the kernel still expects the old Version 2 one to be provided. The + * changes required in nfs_vfsops.c for using the new are documented there in + * comments. (I felt that breaking network booting code by changing this + * structure would not be prudent at this time, since almost all servers are + * still Version 2 anyhow.) + */ +struct nfsv3_diskless { + struct ifaliasreq myif; /* Default interface */ + struct sockaddr_in mygateway; /* Default gateway */ + struct nfs_args root_args; /* Mount args for root fs */ + int root_fhsize; /* Size of root file handle */ + u_char root_fh[NFSX_V3FHMAX]; /* File handle of root dir */ + struct sockaddr_in root_saddr; /* Address of root server */ + char root_hostnam[MNAMELEN]; /* Host name for mount pt */ + long root_time; /* Timestamp of root fs */ + char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */ +}; + +/* + * Old arguments to mount NFS + */ +struct onfs_args { + struct sockaddr *addr; /* file server address */ + int addrlen; /* length of address */ + int sotype; /* Socket type */ + int proto; /* and Protocol */ + u_char *fh; /* File handle to be mounted */ + int fhsize; /* Size, in bytes, of fh */ + int flags; /* flags */ + int wsize; /* write size in bytes */ + int rsize; /* read size in bytes */ + int readdirsize; /* readdir size in bytes */ + int timeo; /* initial timeout in .1 secs */ + int retrans; /* times to retry send */ + int maxgrouplist; /* Max. size of group list */ + int readahead; /* # of blocks to readahead */ + int leaseterm; /* Term (sec) of lease */ + int deadthresh; /* Retrans threshold */ + char *hostname; /* server's name */ +}; + +struct nfs_diskless { + struct ifaliasreq myif; /* Default interface */ + struct sockaddr_in mygateway; /* Default gateway */ + struct onfs_args root_args; /* Mount args for root fs */ + u_char root_fh[NFSX_V2FH]; /* File handle of root dir */ + struct sockaddr_in root_saddr; /* Address of root server */ + char root_hostnam[MNAMELEN]; /* Host name for mount pt */ + long root_time; /* Timestamp of root fs */ + char my_hostnam[MAXHOSTNAMELEN]; /* Client host name */ +}; + +#ifdef _KERNEL +extern struct nfsv3_diskless nfsv3_diskless; +extern struct nfs_diskless nfs_diskless; +extern int nfs_diskless_valid; +void bootpc_init(void); +void nfs_setup_diskless(void); +void nfs_parse_options(const char *, struct nfs_args *); +#endif + +#endif Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Mon Apr 25 22:00:23 2011 (r221031) +++ head/sys/nfsclient/nfs_vfsops.c Mon Apr 25 22:22:51 2011 (r221032) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include FEATURE(nfsclient, "NFS client"); @@ -164,15 +164,6 @@ static struct nfs_rpcops nfs_rpcops = { nfs_commit, }; -/* - * This structure must be filled in by a primary bootstrap or bootstrap - * server for a diskless/dataless machine. It is initialized below just - * to ensure that it is allocated to initialized data (.data not .bss). - */ -struct nfs_diskless nfs_diskless = { { { 0 } } }; -struct nfsv3_diskless nfsv3_diskless = { { { 0 } } }; -int nfs_diskless_valid = 0; - SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD, &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 22:38:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42E93106566B; Mon, 25 Apr 2011 22:38:10 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 322CD8FC0C; Mon, 25 Apr 2011 22:38:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PMcArU095414; Mon, 25 Apr 2011 22:38:10 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PMcAH9095412; Mon, 25 Apr 2011 22:38:10 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201104252238.p3PMcAH9095412@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 25 Apr 2011 22:38:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221035 - head/sys/ia64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 22:38:10 -0000 Author: marcel Date: Mon Apr 25 22:38:09 2011 New Revision: 221035 URL: http://svn.freebsd.org/changeset/base/221035 Log: Remove prototypes of non-existent functions. Modified: head/sys/ia64/include/pmap.h Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Mon Apr 25 22:36:43 2011 (r221034) +++ head/sys/ia64/include/pmap.h Mon Apr 25 22:38:09 2011 (r221035) @@ -127,13 +127,8 @@ void pmap_bootstrap(void); void pmap_kenter(vm_offset_t va, vm_offset_t pa); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); -void pmap_setdevram(unsigned long long basea, vm_offset_t sizea); -int pmap_uses_prom_console(void); void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); -unsigned *pmap_pte(pmap_t, vm_offset_t) __pure2; -void pmap_set_opt (unsigned *); -void pmap_set_opt_bsp (void); struct pmap *pmap_switch(struct pmap *pmap); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 23:12:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0CED1065672; Mon, 25 Apr 2011 23:12:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF1FC8FC0A; Mon, 25 Apr 2011 23:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PNCIgZ096593; Mon, 25 Apr 2011 23:12:18 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PNCIh1096589; Mon, 25 Apr 2011 23:12:18 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104252312.p3PNCIh1096589@svn.freebsd.org> From: Rick Macklem Date: Mon, 25 Apr 2011 23:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221040 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 23:12:18 -0000 Author: rmacklem Date: Mon Apr 25 23:12:18 2011 New Revision: 221040 URL: http://svn.freebsd.org/changeset/base/221040 Log: Modify the experimental (newnfs) NFS client so that it uses the same diskless NFS root code as the regular client, which was moved to sys/nfs by r221032. This fixes the newnfs client so that it can do an NFSv3 diskless root file system. MFC after: 2 weeks Deleted: head/sys/fs/nfsclient/nfsdiskless.h Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs.h head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Mon Apr 25 22:56:53 2011 (r221039) +++ head/sys/fs/nfs/nfs_var.h Mon Apr 25 23:12:18 2011 (r221040) @@ -41,7 +41,6 @@ struct ucred; struct nfscred; NFSPROC_T; struct buf; -struct nfs_diskless; struct sockaddr_in; struct nfs_dlmount; struct file; Modified: head/sys/fs/nfsclient/nfs.h ============================================================================== --- head/sys/fs/nfsclient/nfs.h Mon Apr 25 22:56:53 2011 (r221039) +++ head/sys/fs/nfsclient/nfs.h Mon Apr 25 23:12:18 2011 (r221040) @@ -101,7 +101,6 @@ int ncl_fsinfo(struct nfsmount *, struct struct thread *); int ncl_init(struct vfsconf *); int ncl_uninit(struct vfsconf *); -int ncl_mountroot(struct mount *); void ncl_nfsiodnew(void); void ncl_nfsiodnew_tq(__unused void *, int); Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Mon Apr 25 22:56:53 2011 (r221039) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Mon Apr 25 23:12:18 2011 (r221040) @@ -72,7 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include FEATURE(nfscl, "NFSv4 client"); @@ -97,6 +97,7 @@ static int nfs_tprintf_delay = NFS_TPRIN SYSCTL_INT(_vfs_newnfs, NFS_TPRINTF_DELAY, downdelayinterval, CTLFLAG_RW, &nfs_tprintf_delay, 0, ""); +static int nfs_mountroot(struct mount *); static void nfs_sec_name(char *, int *); static void nfs_decode_args(struct mount *mp, struct nfsmount *nmp, struct nfs_args *argp, const char *, struct ucred *, @@ -140,19 +141,15 @@ MODULE_VERSION(newnfs, 1); * server for a diskless/dataless machine. It is initialized below just * to ensure that it is allocated to initialized data (.data not .bss). */ -struct nfs_diskless newnfs_diskless = { { { 0 } } }; -struct nfsv3_diskless newnfsv3_diskless = { { { 0 } } }; -int newnfs_diskless_valid = 0; - SYSCTL_INT(_vfs_newnfs, OID_AUTO, diskless_valid, CTLFLAG_RD, - &newnfs_diskless_valid, 0, + &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); SYSCTL_STRING(_vfs_newnfs, OID_AUTO, diskless_rootpath, CTLFLAG_RD, - newnfsv3_diskless.root_hostnam, 0, "Path to nfs root"); + nfsv3_diskless.root_hostnam, 0, "Path to nfs root"); SYSCTL_OPAQUE(_vfs_newnfs, OID_AUTO, diskless_rootaddr, CTLFLAG_RD, - &newnfsv3_diskless.root_saddr, sizeof newnfsv3_diskless.root_saddr, + &nfsv3_diskless.root_saddr, sizeof(nfsv3_diskless.root_saddr), "%Ssockaddr_in", "Diskless root nfs address"); @@ -230,29 +227,25 @@ static void nfs_convert_diskless(void) { - bcopy(&newnfs_diskless.myif, &newnfsv3_diskless.myif, - sizeof (struct ifaliasreq)); - bcopy(&newnfs_diskless.mygateway, &newnfsv3_diskless.mygateway, - sizeof (struct sockaddr_in)); - nfs_convert_oargs(&newnfsv3_diskless.root_args, - &newnfs_diskless.root_args); - if (newnfsv3_diskless.root_args.flags & NFSMNT_NFSV3) { - newnfsv3_diskless.root_fhsize = NFSX_MYFH; - bcopy(newnfs_diskless.root_fh, newnfsv3_diskless.root_fh, - NFSX_MYFH); + bcopy(&nfs_diskless.myif, &nfsv3_diskless.myif, + sizeof(struct ifaliasreq)); + bcopy(&nfs_diskless.mygateway, &nfsv3_diskless.mygateway, + sizeof(struct sockaddr_in)); + nfs_convert_oargs(&nfsv3_diskless.root_args,&nfs_diskless.root_args); + if (nfsv3_diskless.root_args.flags & NFSMNT_NFSV3) { + nfsv3_diskless.root_fhsize = NFSX_MYFH; + bcopy(nfs_diskless.root_fh, nfsv3_diskless.root_fh, NFSX_MYFH); } else { - newnfsv3_diskless.root_fhsize = NFSX_V2FH; - bcopy(newnfs_diskless.root_fh, newnfsv3_diskless.root_fh, - NFSX_V2FH); - } - bcopy(&newnfs_diskless.root_saddr,&newnfsv3_diskless.root_saddr, - sizeof(struct sockaddr_in)); - bcopy(newnfs_diskless.root_hostnam, newnfsv3_diskless.root_hostnam, - MNAMELEN); - newnfsv3_diskless.root_time = newnfs_diskless.root_time; - bcopy(newnfs_diskless.my_hostnam, newnfsv3_diskless.my_hostnam, - MAXHOSTNAMELEN); - newnfs_diskless_valid = 3; + nfsv3_diskless.root_fhsize = NFSX_V2FH; + bcopy(nfs_diskless.root_fh, nfsv3_diskless.root_fh, NFSX_V2FH); + } + bcopy(&nfs_diskless.root_saddr,&nfsv3_diskless.root_saddr, + sizeof(struct sockaddr_in)); + bcopy(nfs_diskless.root_hostnam, nfsv3_diskless.root_hostnam, MNAMELEN); + nfsv3_diskless.root_time = nfs_diskless.root_time; + bcopy(nfs_diskless.my_hostnam, nfsv3_diskless.my_hostnam, + MAXHOSTNAMELEN); + nfs_diskless_valid = 3; } /* @@ -358,12 +351,12 @@ ncl_fsinfo(struct nfsmount *nmp, struct /* * Mount a remote root fs via. nfs. This depends on the info in the - * newnfs_diskless structure that has been filled in properly by some primary + * nfs_diskless structure that has been filled in properly by some primary * bootstrap. * It goes something like this: * - do enough of "ifconfig" by calling ifioctl() so that the system * can talk to the server - * - If newnfs_diskless.mygateway is filled in, use that address as + * - If nfs_diskless.mygateway is filled in, use that address as * a default gateway. * - build the rootfs mount point and call mountnfs() to do the rest. * @@ -372,11 +365,11 @@ ncl_fsinfo(struct nfsmount *nmp, struct * nfs_mountroot() will be called once in the boot before any other NFS * client activity occurs. */ -int -ncl_mountroot(struct mount *mp) +static int +nfs_mountroot(struct mount *mp) { struct thread *td = curthread; - struct nfsv3_diskless *nd = &newnfsv3_diskless; + struct nfsv3_diskless *nd = &nfsv3_diskless; struct socket *so; struct vnode *vp; struct ifreq ir; @@ -391,9 +384,9 @@ ncl_mountroot(struct mount *mp) nfs_setup_diskless(); #endif - if (newnfs_diskless_valid == 0) + if (nfs_diskless_valid == 0) return (-1); - if (newnfs_diskless_valid == 1) + if (nfs_diskless_valid == 1) nfs_convert_diskless(); /* @@ -767,7 +760,7 @@ nfs_mount(struct mount *mp) td = curthread; if ((mp->mnt_flag & (MNT_ROOTFS | MNT_UPDATE)) == MNT_ROOTFS) { - error = ncl_mountroot(mp); + error = nfs_mountroot(mp); goto out; } From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 23:29:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E896106566B; Mon, 25 Apr 2011 23:29:45 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-jnhn.mail.uoguelph.ca (esa-jnhn.mail.uoguelph.ca [131.104.91.44]) by mx1.freebsd.org (Postfix) with ESMTP id 202A78FC17; Mon, 25 Apr 2011 23:29:45 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwEAKoCtk2DaFvO/2dsb2JhbACET6FkiHCsG5EwgSmDUH0EjjU X-IronPort-AV: E=Sophos;i="4.64,267,1301889600"; d="scan'208";a="119459151" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-jnhn-pri.mail.uoguelph.ca with ESMTP; 25 Apr 2011 19:29:44 -0400 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 69B20B3F53; Mon, 25 Apr 2011 19:29:44 -0400 (EDT) Date: Mon, 25 Apr 2011 19:29:44 -0400 (EDT) From: Rick Macklem To: Rick Macklem Message-ID: <1630172819.550837.1303774184344.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <201104252222.p3PMMpJe094870@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221032 - in head/sys: amd64/amd64 conf i386/i386 modules/nfscl modules/nfsclient nfs nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 23:29:45 -0000 > Author: rmacklem > Date: Mon Apr 25 22:22:51 2011 > New Revision: 221032 > URL: http://svn.freebsd.org/changeset/base/221032 > > Log: > Fix the experimental NFS client so that it does not bogusly > set the f_flags field of "struct statfs". This had the interesting > effect of making the NFSv4 mounts "disappear" after r221014, > since NFSMNT_NFSV4 and MNT_IGNORE became the same bit. > Move the files used for a diskless NFS root from sys/nfsclient > to sys/nfs in preparation for them to be used by both NFS > clients. Also, move the declaration of the three global data > structures from sys/nfsclient/nfs_vfsops.c to sys/nfs/nfs_diskless.c > so that they are defined when either client uses them. > Oops. The first four lines of this Log message were sitting in the editor from a provious commit and I didn't delete them. I don't think there's an easy way to fix that now? rick From owner-svn-src-head@FreeBSD.ORG Mon Apr 25 23:34:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB2C106566C; Mon, 25 Apr 2011 23:34:22 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F8B08FC18; Mon, 25 Apr 2011 23:34:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3PNYM6S097268; Mon, 25 Apr 2011 23:34:22 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3PNYMe8097265; Mon, 25 Apr 2011 23:34:22 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201104252334.p3PNYMe8097265@svn.freebsd.org> From: Jack F Vogel Date: Mon, 25 Apr 2011 23:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221041 - head/sys/dev/ixgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2011 23:34:22 -0000 Author: jfv Date: Mon Apr 25 23:34:21 2011 New Revision: 221041 URL: http://svn.freebsd.org/changeset/base/221041 Log: - Add the RX refresh changes from igb to ixgbe - Also a couple minor tweaks to the TX code from the same source. - Add the INET ioctl code which has been missing from this driver, and which caused IP aliases to reset the interface. - Last, some minor logic changes that just reflect upcoming hardware support, but have no other functional effect now. MFC after a week Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Apr 25 23:12:18 2011 (r221040) +++ head/sys/dev/ixgbe/ixgbe.c Mon Apr 25 23:34:21 2011 (r221041) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ /*$FreeBSD$*/ #ifdef HAVE_KERNEL_OPTION_HEADERS -#include "opt_device_polling.h" +#include "opt_inet.h" #endif #include "ixgbe.h" @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.8"; +char ixgbe_driver_version[] = "2.3.10"; /********************************************************************* * PCI Device ID Table @@ -270,8 +270,8 @@ TUNABLE_INT("hw.ixgbe.hdr_split", &ixgbe /* * Number of Queues, can be set to 0, * it then autoconfigures based on the - * number of cpus. Each queue is a pair - * of RX and TX rings with a msix vector + * number of cpus with a max of 8. This + * can be overriden manually here. */ static int ixgbe_num_queues = 0; TUNABLE_INT("hw.ixgbe.num_queues", &ixgbe_num_queues); @@ -787,10 +787,6 @@ ixgbe_mq_start_locked(struct ifnet *ifp, 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); @@ -814,7 +810,9 @@ ixgbe_mq_start_locked(struct ifnet *ifp, ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - if (txr->tx_avail <= IXGBE_TX_OP_THRESHOLD) { + if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) + ixgbe_txeof(txr); + if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -864,10 +862,35 @@ ixgbe_ioctl(struct ifnet * ifp, u_long c { struct adapter *adapter = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; +#ifdef INET + struct ifaddr *ifa = (struct ifaddr *)data; +#endif int error = 0; switch (command) { + case SIOCSIFADDR: +#ifdef INET + if (ifa->ifa_addr->sa_family == AF_INET) { + /* + * Since resetting hardware takes a very long time + * and results in link renegotiation we only + * initialize the hardware only when it is absolutely + * required. + */ + ifp->if_flags |= IFF_UP; + if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { + IXGBE_CORE_LOCK(adapter); + ixgbe_init_locked(adapter); + IXGBE_CORE_UNLOCK(adapter); + } + if (!(ifp->if_flags & IFF_NOARP)) + arp_ifinit(ifp, ifa); + } else +#endif + error = ether_ioctl(ifp, command, data); + break; + case SIOCSIFMTU: IOCTL_DEBUGOUT("ioctl: SIOCSIFMTU (Set Interface MTU)"); if (ifr->ifr_mtu > IXGBE_MAX_FRAME_SIZE - ETHER_HDR_LEN) { @@ -989,7 +1012,7 @@ ixgbe_init_locked(struct adapter *adapte if (ifp->if_capenable & IFCAP_TXCSUM) { ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); #if __FreeBSD_version >= 800000 - if (hw->mac.type == ixgbe_mac_82599EB) + if (hw->mac.type != ixgbe_mac_82598EB) ifp->if_hwassist |= CSUM_SCTP; #endif } @@ -1032,14 +1055,12 @@ ixgbe_init_locked(struct adapter *adapte gpie = IXGBE_READ_REG(&adapter->hw, IXGBE_GPIE); - if (hw->mac.type == ixgbe_mac_82599EB) { - gpie |= IXGBE_SDP1_GPIEN; - gpie |= IXGBE_SDP2_GPIEN; - } - /* Enable Fan Failure Interrupt */ - if (hw->device_id == IXGBE_DEV_ID_82598AT) - gpie |= IXGBE_SDP1_GPIEN; + gpie |= IXGBE_SDP1_GPIEN; + + /* Add for Thermal detection */ + if (hw->mac.type == ixgbe_mac_82599EB) + gpie |= IXGBE_SDP2_GPIEN; if (adapter->msix > 1) { /* Enable Enhanced MSIX mode */ @@ -1121,7 +1142,7 @@ ixgbe_init_locked(struct adapter *adapte #ifdef IXGBE_FDIR /* Init Flow director */ - if (hw->mac.type == ixgbe_mac_82599EB) + if (hw->mac.type != ixgbe_mac_82598EB) ixgbe_init_fdir_signature_82599(&adapter->hw, fdir_pballoc); #endif @@ -1338,8 +1359,6 @@ ixgbe_msix_que(void *arg) more_tx = ixgbe_txeof(txr); IXGBE_TX_UNLOCK(txr); - more_rx = ixgbe_rxeof(que, adapter->rx_process_limit); - /* Do AIM now? */ if (ixgbe_enable_aim == FALSE) @@ -1417,7 +1436,7 @@ ixgbe_msix_link(void *arg) if (reg_eicr & IXGBE_EICR_LSC) taskqueue_enqueue(adapter->tq, &adapter->link_task); - if (adapter->hw.mac.type == ixgbe_mac_82599EB) { + if (adapter->hw.mac.type != ixgbe_mac_82598EB) { #ifdef IXGBE_FDIR if (reg_eicr & IXGBE_EICR_FLOW_DIR) { /* This is probably overkill :) */ @@ -2792,7 +2811,7 @@ ixgbe_setup_transmit_ring(struct tx_ring #ifdef IXGBE_FDIR /* Set the rate at which we sample packets */ - if (adapter->hw.mac.type == ixgbe_mac_82599EB) + if (adapter->hw.mac.type != ixgbe_mac_82598EB) txr->atr_sample = atr_sample_rate; #endif @@ -2874,7 +2893,7 @@ ixgbe_initialize_transmit_units(struct a } - if (hw->mac.type == ixgbe_mac_82599EB) { + if (hw->mac.type != ixgbe_mac_82598EB) { u32 dmatxctl, rttdcs; dmatxctl = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); dmatxctl |= IXGBE_DMATXCTL_TE; @@ -3386,11 +3405,15 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, bus_dma_segment_t pseg[1]; struct ixgbe_rx_buf *rxbuf; struct mbuf *mh, *mp; - int i, nsegs, error, cleaned; + int i, j, nsegs, error; + bool refreshed = FALSE; - i = rxr->next_to_refresh; - cleaned = -1; /* Signify no completions */ - while (i != limit) { + i = j = rxr->next_to_refresh; + /* Control the loop with one beyond */ + if (++j == adapter->num_rx_desc) + j = 0; + + while (j != limit) { rxbuf = &rxr->rx_buffers[i]; if (rxr->hdr_split == FALSE) goto no_split; @@ -3418,7 +3441,8 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, rxbuf->m_head = mh; bus_dmamap_sync(rxr->htag, rxbuf->hmap, BUS_DMASYNC_PREREAD); - rxr->rx_base[i].read.hdr_addr = htole64(hseg[0].ds_addr); + rxr->rx_base[i].read.hdr_addr = + htole64(hseg[0].ds_addr); no_split: if (rxbuf->m_pack == NULL) { @@ -3446,17 +3470,17 @@ no_split: rxr->rx_base[i].read.pkt_addr = htole64(pseg[0].ds_addr); - cleaned = i; - /* Calculate next index */ - if (++i == adapter->num_rx_desc) - i = 0; - /* This is the work marker for refresh */ + refreshed = TRUE; + /* Next is precalculated */ + i = j; rxr->next_to_refresh = i; + if (++j == adapter->num_rx_desc) + j = 0; } update: - if (cleaned != -1) /* If we refreshed some, bump tail */ + if (refreshed) /* Update hardware tail index */ IXGBE_WRITE_REG(&adapter->hw, - IXGBE_RDT(rxr->me), cleaned); + IXGBE_RDT(rxr->me), rxr->next_to_refresh); return; } @@ -3727,6 +3751,7 @@ skip_head: rxr->lro_enabled = FALSE; rxr->rx_split_packets = 0; rxr->rx_bytes = 0; + rxr->discard = FALSE; bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); @@ -3736,7 +3761,7 @@ skip_head: ** 82598 uses software LRO, the ** 82599 uses a hardware assist. */ - if ((adapter->hw.mac.type == ixgbe_mac_82599EB) && + if ((adapter->hw.mac.type != ixgbe_mac_82598EB) && (ifp->if_capenable & IFCAP_RXCSUM) && (ifp->if_capenable & IFCAP_LRO)) ixgbe_setup_hw_rsc(rxr); @@ -3862,8 +3887,7 @@ ixgbe_initialize_receive_units(struct ad IXGBE_WRITE_REG(hw, IXGBE_RDT(i), 0); } - if (adapter->hw.mac.type == ixgbe_mac_82599EB) { - /* PSRTYPE must be initialized in 82599 */ + if (adapter->hw.mac.type != ixgbe_mac_82598EB) { u32 psrtype = IXGBE_PSRTYPE_TCPHDR | IXGBE_PSRTYPE_UDPHDR | IXGBE_PSRTYPE_IPV4HDR | @@ -4307,10 +4331,8 @@ next_desc: } /* Refresh any remaining buf structs */ - if (processed != 0) { + if (ixgbe_rx_unrefreshed(rxr)) ixgbe_refresh_mbufs(rxr, i); - processed = 0; - } rxr->next_to_check = i; @@ -4472,7 +4494,7 @@ ixgbe_setup_vlan_hw_support(struct adapt IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, ctrl); /* On 82599 the VLAN enable is per/queue in RXDCTL */ - if (hw->mac.type == ixgbe_mac_82599EB) + if (hw->mac.type != ixgbe_mac_82598EB) for (int i = 0; i < adapter->num_queues; i++) { ctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(i)); ctrl |= IXGBE_RXDCTL_VME; @@ -4491,9 +4513,7 @@ ixgbe_enable_intr(struct adapter *adapte /* Enable Fan Failure detection */ if (hw->device_id == IXGBE_DEV_ID_82598AT) mask |= IXGBE_EIMS_GPI_SDP1; - - /* 82599 specific interrupts */ - if (adapter->hw.mac.type == ixgbe_mac_82599EB) { + else { mask |= IXGBE_EIMS_ECC; mask |= IXGBE_EIMS_GPI_SDP1; mask |= IXGBE_EIMS_GPI_SDP2; @@ -4810,7 +4830,7 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.gprc += IXGBE_READ_REG(hw, IXGBE_GPRC); adapter->stats.gprc -= missed_rx; - if (hw->mac.type == ixgbe_mac_82599EB) { + if (hw->mac.type != ixgbe_mac_82598EB) { adapter->stats.gorc += IXGBE_READ_REG(hw, IXGBE_GORCL) + ((u64)IXGBE_READ_REG(hw, IXGBE_GORCH) << 32); adapter->stats.gotc += IXGBE_READ_REG(hw, IXGBE_GOTCL) + @@ -4878,7 +4898,7 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); adapter->stats.fclast += IXGBE_READ_REG(hw, IXGBE_FCLAST); /* Only read FCOE on 82599 */ - if (hw->mac.type == ixgbe_mac_82599EB) { + if (hw->mac.type != ixgbe_mac_82598EB) { adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Mon Apr 25 23:12:18 2011 (r221040) +++ head/sys/dev/ixgbe/ixgbe.h Mon Apr 25 23:34:21 2011 (r221041) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2011, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -497,4 +497,19 @@ drbr_needs_enqueue(struct ifnet *ifp, st } #endif +/* +** Find the number of unrefreshed RX descriptors +*/ +static inline u16 +ixgbe_rx_unrefreshed(struct rx_ring *rxr) +{ + struct adapter *adapter = rxr->adapter; + + if (rxr->next_to_check > rxr->next_to_refresh) + return (rxr->next_to_check - rxr->next_to_refresh - 1); + else + return ((adapter->num_rx_desc + rxr->next_to_check) - + rxr->next_to_refresh - 1); +} + #endif /* _IXGBE_H_ */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 00:22:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2498E106566B; Tue, 26 Apr 2011 00:22:18 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1400E8FC08; Tue, 26 Apr 2011 00:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3Q0MH0J098935; Tue, 26 Apr 2011 00:22:17 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3Q0MHde098931; Tue, 26 Apr 2011 00:22:17 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104260022.p3Q0MHde098931@svn.freebsd.org> From: Rick Macklem Date: Tue, 26 Apr 2011 00:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221046 - in head/etc: defaults rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 00:22:18 -0000 Author: rmacklem Date: Tue Apr 26 00:22:17 2011 New Revision: 221046 URL: http://svn.freebsd.org/changeset/base/221046 Log: Update the /etc/rc.d scripts for mountd and nfsd so they can use the "-o" option to force the old NFS server to run. Running the old NFS server is enabled by setting oldnfs_server_enable="YES". The scripts will only enable providing service for NFSv4 if nfsv4_server_enable="YES" is set. Reviewed by: dougb (rc) Modified: head/etc/defaults/rc.conf head/etc/rc.d/mountd head/etc/rc.d/nfsd Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Tue Apr 26 00:20:04 2011 (r221045) +++ head/etc/defaults/rc.conf Tue Apr 26 00:22:17 2011 (r221046) @@ -323,6 +323,7 @@ amd_map_program="NO" # Can be set to "y nfs_client_enable="NO" # This host is an NFS client (or NO). nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). +oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). nfs_server_flags="-u -t -n 4" # Flags to nfsd (if enabled). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Tue Apr 26 00:20:04 2011 (r221045) +++ head/etc/rc.d/mountd Tue Apr 26 00:22:17 2011 (r221046) @@ -37,11 +37,10 @@ mountd_precmd() fi fi - # If nfsv4_server_enable is yes, force use of the experimental - # server + # If oldnfs_server_enable is yes, force use of the old NFS server # - if checkyesno nfsv4_server_enable; then - rc_flags="-e ${rc_flags}" + if checkyesno oldnfs_server_enable; then + rc_flags="-o ${rc_flags}" fi if checkyesno zfs_enable; then Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Tue Apr 26 00:20:04 2011 (r221045) +++ head/etc/rc.d/nfsd Tue Apr 26 00:22:17 2011 (r221046) @@ -19,19 +19,8 @@ sig_stop="USR1" nfsd_precmd() { - if checkyesno nfsv4_server_enable; then - # If nfsv4_server_enable is yes, force use - # of the experimental server - # - rc_flags="-e ${nfs_server_flags}" - - if ! checkyesno nfsuserd_enable && \ - ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 - then - force_depend nfsuserd || return 1 - fi - else - rc_flags="${nfs_server_flags}" + if checkyesno oldnfs_server_enable; then + rc_flags="-o ${nfs_server_flags}" if ! sysctl vfs.nfsrv >/dev/null 2>&1; then force_depend nfsserver || return 1 @@ -41,6 +30,30 @@ nfsd_precmd() echo 'NFS on reserved port only=YES' sysctl vfs.nfsrv.nfs_privport=1 > /dev/null fi + else + rc_flags="${nfs_server_flags}" + + # Load the modules now, so that the vfs.newnfs sysctl + # oids are available. + load_kld nfsd + + if checkyesno nfs_reserved_port_only; then + echo 'NFS on reserved port only=YES' + sysctl vfs.newnfs.nfs_privport=1 > /dev/null + fi + + if checkyesno nfsv4_server_enable; then + if ! checkyesno nfsuserd_enable && \ + ! /etc/rc.d/nfsuserd forcestatus 1>/dev/null 2>&1 + then + if ! force_depend nfsuserd; then + err 1 "Cannot run nfsuserd" + fi + fi + else + echo 'NFSv4 is disabled' + sysctl vfs.newnfs.server_max_nfsvers=3 > /dev/null + fi fi if ! checkyesno rpcbind_enable && \ From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 02:06:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 107231065674; Tue, 26 Apr 2011 02:06:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3BAF8FC15; Tue, 26 Apr 2011 02:06:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3Q26VIe002223; Tue, 26 Apr 2011 02:06:31 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3Q26Vh8002221; Tue, 26 Apr 2011 02:06:31 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201104260206.p3Q26Vh8002221@svn.freebsd.org> From: Colin Percival Date: Tue, 26 Apr 2011 02:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221049 - head/sbin/newfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 02:06:32 -0000 Author: cperciva Date: Tue Apr 26 02:06:31 2011 New Revision: 221049 URL: http://svn.freebsd.org/changeset/base/221049 Log: Stop trying to zero UFS1 superblocks if we fall off the end of the disk. This avoids a potentially many-hours-long loop of failed writes if newfs finds a partially-overwritten superblock (or, for that matter, random garbage which happens to have superblock magic bytes); on one occasion I found newfs trying to zero 800 million superblocks on a 50 MB disk. Reviewed by: mckusick MFC after: 1 week Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Tue Apr 26 01:56:18 2011 (r221048) +++ head/sbin/newfs/mkfs.c Tue Apr 26 02:06:31 2011 (r221049) @@ -516,9 +516,12 @@ restart: fsdummy.fs_magic = 0; bwrite(&disk, part_ofs + SBLOCK_UFS1 / disk.d_bsize, chdummy, SBLOCKSIZE); - for (cg = 0; cg < fsdummy.fs_ncg; cg++) + for (cg = 0; cg < fsdummy.fs_ncg; cg++) { + if (fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)) > fssize) + break; bwrite(&disk, part_ofs + fsbtodb(&fsdummy, cgsblock(&fsdummy, cg)), chdummy, SBLOCKSIZE); + } } } if (!Nflag) From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 04:01:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AB91106566B; Tue, 26 Apr 2011 04:01:08 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88A9B8FC08; Tue, 26 Apr 2011 04:01:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3Q418Lg005951; Tue, 26 Apr 2011 04:01:08 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3Q418O4005949; Tue, 26 Apr 2011 04:01:08 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201104260401.p3Q418O4005949@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 26 Apr 2011 04:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221052 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 04:01:08 -0000 Author: obrien Date: Tue Apr 26 04:01:08 2011 New Revision: 221052 URL: http://svn.freebsd.org/changeset/base/221052 Log: Catch up with r57841 which removed the possible linking against libutil by not bothering to include its API. Modified: head/usr.bin/rlogin/rlogin.c Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Tue Apr 26 03:27:21 2011 (r221051) +++ head/usr.bin/rlogin/rlogin.c Tue Apr 26 04:01:08 2011 (r221052) @@ -72,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 04:09:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE74A106564A; Tue, 26 Apr 2011 04:09:20 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C204A8FC15; Tue, 26 Apr 2011 04:09:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3Q49KQR006274; Tue, 26 Apr 2011 04:09:20 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3Q49KaJ006272; Tue, 26 Apr 2011 04:09:20 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201104260409.p3Q49KaJ006272@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 26 Apr 2011 04:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221053 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 04:09:21 -0000 Author: obrien Date: Tue Apr 26 04:09:20 2011 New Revision: 221053 URL: http://svn.freebsd.org/changeset/base/221053 Log: This builds OK using the parent dir's WARNS=6. [built on both AMD64 and i386] Modified: head/usr.bin/rlogin/Makefile Modified: head/usr.bin/rlogin/Makefile ============================================================================== --- head/usr.bin/rlogin/Makefile Tue Apr 26 04:01:08 2011 (r221052) +++ head/usr.bin/rlogin/Makefile Tue Apr 26 04:09:20 2011 (r221053) @@ -7,6 +7,4 @@ BINOWN= root BINMODE=4555 PRECIOUSPROG= -WARNS?= 3 - .include From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 04:45:08 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40D97106566C; Tue, 26 Apr 2011 04:45:08 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id 1E8758FC19; Tue, 26 Apr 2011 04:45:07 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id p3Q4j7dV008806; Mon, 25 Apr 2011 21:45:07 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id p3Q4j7YV008805; Mon, 25 Apr 2011 21:45:07 -0700 (PDT) (envelope-from obrien) Date: Mon, 25 Apr 2011 21:45:07 -0700 From: "David O'Brien" To: Mark Murray Message-ID: <20110426044507.GA8767@dragon.NUXI.org> References: <201104091402.p39E24bm016157@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104091402.p39E24bm016157@svn.freebsd.org> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r220497 - head/lib/libcrypt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 04:45:08 -0000 On Sat, Apr 09, 2011 at 02:02:04PM +0000, Mark Murray wrote: > Log: > Add SHA256/512 ($5$ and $6$) to crypt(3). Used in linux-world, doesn't > hurt us. Would you mind if I committed this to be a more consistent with the existing naming? Index: crypt.c =================================================================== --- crypt.c (revision 221053) +++ crypt.c (working copy) @@ -64,12 +64,12 @@ static const struct { }, { "sha256", - sha256_crypt, + crypt_sha256, "$5$" }, { "sha512", - sha512_crypt, + crypt_sha512, "$6$" }, { Index: crypt-sha512.c =================================================================== --- crypt-sha512.c (revision 221053) +++ crypt-sha512.c (working copy) @@ -60,7 +60,7 @@ static const char sha512_rounds_prefix[] #define ROUNDS_MAX 999999999 static char * -sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen) +crypt_sha512_r(const char *key, const char *salt, char *buffer, int buflen) { u_long srounds; int n; @@ -280,12 +280,12 @@ sha512_crypt_r(const char *key, const ch /* This entry point is equivalent to crypt(3). */ char * -sha512_crypt(const char *key, const char *salt) +crypt_sha512(const char *key, const char *salt) { /* We don't want to have an arbitrary limit in the size of the * password. We can compute an upper bound for the size of the * result in advance and so we can prepare the buffer we pass to - * `sha512_crypt_r'. */ + * `crypt_sha512_r'. */ static char *buffer; static int buflen; int needed; @@ -305,7 +305,7 @@ sha512_crypt(const char *key, const char buflen = needed; } - return sha512_crypt_r(key, salt, buffer, buflen); + return crypt_sha512_r(key, salt, buffer, buflen); } #ifdef TEST @@ -482,7 +482,7 @@ main(void) } for (cnt = 0; cnt < ntests2; ++cnt) { - char *cp = sha512_crypt(tests2[cnt].input, tests2[cnt].salt); + char *cp = crypt_sha512(tests2[cnt].input, tests2[cnt].salt); if (strcmp(cp, tests2[cnt].expected) != 0) { printf("test %d: expected \"%s\", got \"%s\"\n", Index: crypt.h =================================================================== --- crypt.h (revision 221053) +++ crypt.h (working copy) @@ -36,8 +36,8 @@ char *crypt_des(const char *pw, const ch char *crypt_md5(const char *pw, const char *salt); char *crypt_nthash(const char *pw, const char *salt); char *crypt_blowfish(const char *pw, const char *salt); -char *sha256_crypt (const char *pw, const char *salt); -char *sha512_crypt (const char *pw, const char *salt); +char *crypt_sha256 (const char *pw, const char *salt); +char *crypt_sha512 (const char *pw, const char *salt); extern void _crypt_to64(char *s, u_long v, int n); extern void b64_from_24bit(uint8_t B2, uint8_t B1, uint8_t B0, int n, int *buflen, char **cp); Index: crypt-sha256.c =================================================================== --- crypt-sha256.c (revision 221053) +++ crypt-sha256.c (working copy) @@ -60,7 +60,7 @@ static const char sha256_rounds_prefix[] #define ROUNDS_MAX 999999999 static char * -sha256_crypt_r(const char *key, const char *salt, char *buffer, int buflen) +crypt_sha256_r(const char *key, const char *salt, char *buffer, int buflen) { u_long srounds; int n; @@ -268,12 +268,12 @@ sha256_crypt_r(const char *key, const ch /* This entry point is equivalent to crypt(3). */ char * -sha256_crypt(const char *key, const char *salt) +crypt_sha256(const char *key, const char *salt) { /* We don't want to have an arbitrary limit in the size of the * password. We can compute an upper bound for the size of the * result in advance and so we can prepare the buffer we pass to - * `sha256_crypt_r'. */ + * `crypt_sha256_r'. */ static char *buffer; static int buflen; int needed; @@ -293,7 +293,7 @@ sha256_crypt(const char *key, const char buflen = needed; } - return sha256_crypt_r(key, salt, buffer, buflen); + return crypt_sha256_r(key, salt, buffer, buflen); } #ifdef TEST @@ -459,7 +459,7 @@ main(void) } for (cnt = 0; cnt < ntests2; ++cnt) { - char *cp = sha256_crypt(tests2[cnt].input, tests2[cnt].salt); + char *cp = crypt_sha256(tests2[cnt].input, tests2[cnt].salt); if (strcmp(cp, tests2[cnt].expected) != 0) { printf("test %d: expected \"%s\", got \"%s\"\n", From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 07:00:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D47491065670; Tue, 26 Apr 2011 07:00:39 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 562988FC16; Tue, 26 Apr 2011 07:00:39 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 37F1445EA4; Tue, 26 Apr 2011 09:00:37 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 664BE45683; Tue, 26 Apr 2011 09:00:31 +0200 (CEST) Date: Tue, 26 Apr 2011 09:00:20 +0200 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110426070020.GC2472@garage.freebsd.pl> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Izn7cH1Com+I3R9J" Content-Disposition: inline In-Reply-To: <4DB5B0A9.4030805@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:00:39 -0000 --Izn7cH1Com+I3R9J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote: > I've thought about the process of fixing hardcoded provider names there, > and it is absolutely not trivial. If we take the "symlinking" way (patch > is already posted to current@), I think it will be much easier for > everybody, and especially users, if I hack all mentioned above GEOM > classes to ignore adX/adaY difference in provider names. And it should > perfectly fit into remaining time window. Could you be more specific what the hack would do exactly? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --Izn7cH1Com+I3R9J Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22bYQACgkQForvXbEpPzTQOwCeOzQzd3/ZdFmOabyFTElzTgfA tpMAoMQOyLr7SpvsX9TDwFu76b6zuKxh =Bzph -----END PGP SIGNATURE----- --Izn7cH1Com+I3R9J-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 07:03:18 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 332CE1065670; Tue, 26 Apr 2011 07:03:18 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id BFB178FC0C; Tue, 26 Apr 2011 07:03:17 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id B9EC545EE5; Tue, 26 Apr 2011 09:03:16 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 8062045EA7; Tue, 26 Apr 2011 09:03:11 +0200 (CEST) Date: Tue, 26 Apr 2011 09:03:00 +0200 From: Pawel Jakub Dawidek To: Garrett Cooper Message-ID: <20110426070300.GD2472@garage.freebsd.pl> References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <11B524F2-70D6-4B8A-BC7C-005EB5D6E393@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HWvPVVuAAfuRc6SZ" Content-Disposition: inline In-Reply-To: <11B524F2-70D6-4B8A-BC7C-005EB5D6E393@gmail.com> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: "src-committers@FreeBSD.org" , Alexander Motin , "Bjoern A. Zeeb" , Robert Watson , "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:03:18 -0000 --HWvPVVuAAfuRc6SZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 25, 2011 at 12:16:22PM -0700, Garrett Cooper wrote: > I'd prefer having an UPDATING note with all of the affected areas so that= people can understand what needs to change and adjust their systems accord= ingly. As far as geom based hardcoding is concerned: maybe this can serve a= s a good lesson of what shouldn't be done and what should be fixed/have a t= ranslation layer added for this item? Hardcoding provider names in metadata is not mistake. It was added to protect against hacks like the 'c' partition. In the system there might be serval providers representing exactly same data and hardcoding provider name allows to choose the proper one. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --HWvPVVuAAfuRc6SZ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22biQACgkQForvXbEpPzSZKgCgu0PVkYsS4LcMRsCY8uPggzht fyQAnilOlOSQJeb2Xh5H+7wKPtOkM6S4 =dXSu -----END PGP SIGNATURE----- --HWvPVVuAAfuRc6SZ-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 07:20:01 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC63106564A; Tue, 26 Apr 2011 07:20:01 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id D76C28FC08; Tue, 26 Apr 2011 07:19:59 +0000 (UTC) Received: by bwz12 with SMTP id 12so423798bwz.13 for ; Tue, 26 Apr 2011 00:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=9c0dJAcb8nj0O8DR8Oi1CWgdy9Ol0VcyFFzVccckl44=; b=OsZJY8nyhN5ya1Eko+BpXG5cfqz2lYhtCqVTB9Ts8dY1ZmUo6laSfS6PQf9FxDIPDn XNZKE4KfU3hJYt1gIERNm5AF6Gqo3kRE23foc5A4USEk64FuQ7/IunUEFOy2bpBGtniG L6WQ+t6ucR6RSfDKHELRZUM+onBc7HRxt5YXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=m3GVYhyDfNX3HWBfCrguy4Y0NB2ahJBCOJ/B7q67VLM7BxElCg/IDFdC3+WDurGVyM P9coKMgp80Rl7uFHaNow51pjSqx9JE7UwuZdYHHL1sAecH9XOlh7CXbxR3wIskJmnRDB qSEqtD3WPsnw4psUG4KfaYJ2yyh+f5M2tKGEU= Received: by 10.204.82.143 with SMTP id b15mr361894bkl.118.1303802398901; Tue, 26 Apr 2011 00:19:58 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id w3sm3670075bkt.5.2011.04.26.00.19.56 (version=SSLv3 cipher=OTHER); Tue, 26 Apr 2011 00:19:58 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB6721B.3020600@FreeBSD.org> Date: Tue, 26 Apr 2011 10:19:55 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201104240858.p3O8wwqT024628@svn.freebsd.org> <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> In-Reply-To: <20110426070020.GC2472@garage.freebsd.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:20:01 -0000 On 26.04.2011 10:00, Pawel Jakub Dawidek wrote: > On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote: >> I've thought about the process of fixing hardcoded provider names there, >> and it is absolutely not trivial. If we take the "symlinking" way (patch >> is already posted to current@), I think it will be much easier for >> everybody, and especially users, if I hack all mentioned above GEOM >> classes to ignore adX/adaY difference in provider names. And it should >> perfectly fit into remaining time window. > > Could you be more specific what the hack would do exactly? I would write some comparison function, which would search both names for adX/adaY prefixes, if they found on both arguments, trimmed them and compared remaining parts. I think for usual purpose of name hardcoding device name part is less important. Comparing partition names part should be enough. The tricky part there is to properly identify device part, so I was thinking about specific hack for adX/adaY. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 07:30:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FF701065670; Tue, 26 Apr 2011 07:30:53 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6F518FC0A; Tue, 26 Apr 2011 07:30:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3Q7UqQg012318; Tue, 26 Apr 2011 07:30:52 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3Q7UqbD012314; Tue, 26 Apr 2011 07:30:52 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201104260730.p3Q7UqbD012314@svn.freebsd.org> From: Jeff Roberson Date: Tue, 26 Apr 2011 07:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221055 - in head/sys: kern ofed/include/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:30:53 -0000 Author: jeff Date: Tue Apr 26 07:30:52 2011 New Revision: 221055 URL: http://svn.freebsd.org/changeset/base/221055 Log: - Catch up to falloc() changes. - PHOLD() before using a task structure on the stack. - Fix a LOR between the sleepq lock and thread lock in _intr_drain(). Modified: head/sys/kern/kern_intr.c head/sys/ofed/include/linux/file.h head/sys/ofed/include/linux/workqueue.h Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Tue Apr 26 04:52:35 2011 (r221054) +++ head/sys/kern/kern_intr.c Tue Apr 26 07:30:52 2011 (r221055) @@ -746,7 +746,6 @@ intr_handler_source(void *cookie) void _intr_drain(int irq) { - struct mtx *mtx; struct intr_event *ie; struct intr_thread *ithd; struct thread *td; @@ -758,13 +757,21 @@ _intr_drain(int irq) return; ithd = ie->ie_thread; td = ithd->it_thread; + /* + * We set the flag and wait for it to be cleared to avoid + * long delays with potentially busy interrupt handlers + * were we to only sample TD_AWAITING_INTR() every tick. + */ thread_lock(td); - mtx = td->td_lock; if (!TD_AWAITING_INTR(td)) { ithd->it_flags |= IT_WAIT; - msleep_spin(ithd, mtx, "isync", 0); + while (ithd->it_flags & IT_WAIT) { + thread_unlock(td); + pause("idrain", 1); + thread_lock(td); + } } - mtx_unlock_spin(mtx); + thread_unlock(td); return; } Modified: head/sys/ofed/include/linux/file.h ============================================================================== --- head/sys/ofed/include/linux/file.h Tue Apr 26 04:52:35 2011 (r221054) +++ head/sys/ofed/include/linux/file.h Tue Apr 26 07:30:52 2011 (r221055) @@ -92,7 +92,7 @@ get_unused_fd(void) int error; int fd; - error = falloc(curthread, &file, &fd); + error = falloc(curthread, &file, &fd, 0); if (error) return -error; return fd; Modified: head/sys/ofed/include/linux/workqueue.h ============================================================================== --- head/sys/ofed/include/linux/workqueue.h Tue Apr 26 04:52:35 2011 (r221054) +++ head/sys/ofed/include/linux/workqueue.h Tue Apr 26 07:30:52 2011 (r221055) @@ -160,9 +160,11 @@ flush_taskqueue(struct taskqueue *tq) { struct task flushtask; + PHOLD(curproc); TASK_INIT(&flushtask, 0, _flush_fn, NULL); taskqueue_enqueue(tq, &flushtask); taskqueue_drain(tq, &flushtask); + PRELE(curproc); } static inline int From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 07:35:37 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CE4F106566C; Tue, 26 Apr 2011 07:35:37 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 643138FC15; Tue, 26 Apr 2011 07:35:36 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 5C1FE45E87; Tue, 26 Apr 2011 09:35:34 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 255E545685; Tue, 26 Apr 2011 09:35:28 +0200 (CEST) Date: Tue, 26 Apr 2011 09:35:17 +0200 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110426073517.GF2472@garage.freebsd.pl> References: <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="65ImJOski3p8EhYV" Content-Disposition: inline In-Reply-To: <4DB6721B.3020600@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:35:37 -0000 --65ImJOski3p8EhYV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote: > On 26.04.2011 10:00, Pawel Jakub Dawidek wrote: > >On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote: > >>I've thought about the process of fixing hardcoded provider names there, > >>and it is absolutely not trivial. If we take the "symlinking" way (patch > >>is already posted to current@), I think it will be much easier for > >>everybody, and especially users, if I hack all mentioned above GEOM > >>classes to ignore adX/adaY difference in provider names. And it should > >>perfectly fit into remaining time window. > > > >Could you be more specific what the hack would do exactly? >=20 > I would write some comparison function, which would search both > names for adX/adaY prefixes, if they found on both arguments, > trimmed them and compared remaining parts. >=20 > I think for usual purpose of name hardcoding device name part is > less important. Comparing partition names part should be enough. The > tricky part there is to properly identify device part, so I was > thinking about specific hack for adX/adaY. I was wondering how would you match X and Y, but this is indeed not important. So on taste we could do (totally untested): static bool provider_name_matches(const char *ppname, const char *hcname) { if (strcmp(ppname, hcname) =3D=3D 0) return (true); if (strncmp(hcname, "ad", 2) !=3D 0 || hcname[2] < '0' || hcname[2] > '9') { return (false); } if (strncmp(ppname, "ada", 3) !=3D 0 || ppname[3] < '0' || ppname[3] > '9') { return (false); } /* Skip 'ad[0-9]+'. */ hcname +=3D 3; while (hcname[0] >=3D '0' && hcname[0] <=3D '9') hcname++; /* Skip 'ada[0-9]+'. ppname +=3D 4; while (ppname[0] >=3D '0' && ppname[0] <=3D '9') ppname++; return (strcmp(ppname, hcname) =3D=3D 0); } That could work. Another possibility I was thinking of was to create GEOM providers for both names and orphan the other name once one of them is opened for writing. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --65ImJOski3p8EhYV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22dbUACgkQForvXbEpPzQbigCeNwDcYVHDWMG/NqzX+qOsTWXz 78cAnjuTBx9e7BEOTy/1NohoWyeiBGs1 =jhHX -----END PGP SIGNATURE----- --65ImJOski3p8EhYV-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 07:50:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A4D9106564A; Tue, 26 Apr 2011 07:50:23 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AE4EE8FC16; Tue, 26 Apr 2011 07:50:21 +0000 (UTC) Received: by bwz12 with SMTP id 12so443993bwz.13 for ; Tue, 26 Apr 2011 00:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=swLLm8VLPa2VdgNxVK6k6qEQ4diKhA/QJerEcAJd6EI=; b=WUf+9pgFkAG2VYJ7ObLx3LCgM20HVvJ5bTre2qRdGpfCOvVHBBJ8f5DtfblLv59TX5 URLWhX+FiqBSFnZWwnWBM0jgDnf3gVvdb5WdbNVYldqA5smIRIlivBf4GpHfYh+46Q/3 r5Amn3XFBQQKg6sJThmA5a9I05Qe4PRN5Jlhg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=w35GqtSLzUuPbOdW1DSH5qgIoE3w+AFw/6Dm7Dl4qhWH6m1V/kikXgByau/aK+E5xr WRnAGthfW7mvrPX5KFagvRCXkMaBSSMRKaK80NfMuMu/0365Oe17wEhqY+nCvdoe6fIU oA2UxYLrAlgpw1knaFseaghe3ptysjKq3fCe0= Received: by 10.204.19.83 with SMTP id z19mr372562bka.191.1303804220741; Tue, 26 Apr 2011 00:50:20 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l1sm3686680bkl.1.2011.04.26.00.50.18 (version=SSLv3 cipher=OTHER); Tue, 26 Apr 2011 00:50:20 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB67939.6080301@FreeBSD.org> Date: Tue, 26 Apr 2011 10:50:17 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <4DB441B0.8020906@FreeBSD.org> <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> <20110426073517.GF2472@garage.freebsd.pl> In-Reply-To: <20110426073517.GF2472@garage.freebsd.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 07:50:23 -0000 On 26.04.2011 10:35, Pawel Jakub Dawidek wrote: > On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote: >> On 26.04.2011 10:00, Pawel Jakub Dawidek wrote: >>> On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote: >>>> I've thought about the process of fixing hardcoded provider names there, >>>> and it is absolutely not trivial. If we take the "symlinking" way (patch >>>> is already posted to current@), I think it will be much easier for >>>> everybody, and especially users, if I hack all mentioned above GEOM >>>> classes to ignore adX/adaY difference in provider names. And it should >>>> perfectly fit into remaining time window. >>> >>> Could you be more specific what the hack would do exactly? >> >> I would write some comparison function, which would search both >> names for adX/adaY prefixes, if they found on both arguments, >> trimmed them and compared remaining parts. >> >> I think for usual purpose of name hardcoding device name part is >> less important. Comparing partition names part should be enough. The >> tricky part there is to properly identify device part, so I was >> thinking about specific hack for adX/adaY. > > I was wondering how would you match X and Y, but this is indeed not > important. So on taste we could do (totally untested): > > static bool > provider_name_matches(const char *ppname, const char *hcname) > { > > if (strcmp(ppname, hcname) == 0) > return (true); > if (strncmp(hcname, "ad", 2) != 0 || > hcname[2]< '0' || hcname[2]> '9') { > return (false); > } > if (strncmp(ppname, "ada", 3) != 0 || > ppname[3]< '0' || ppname[3]> '9') { > return (false); > } > /* Skip 'ad[0-9]+'. */ > hcname += 3; > while (hcname[0]>= '0'&& hcname[0]<= '9') > hcname++; > /* Skip 'ada[0-9]+'. > ppname += 4; > while (ppname[0]>= '0'&& ppname[0]<= '9') > ppname++; > > return (strcmp(ppname, hcname) == 0); > } > > That could work. Yes, I was thinking about something like that. May be just symmetric, so it could handle some cases of downgrade. > Another possibility I was thinking of was to create GEOM providers for > both names and orphan the other name once one of them is opened for > writing. I've even implemented patch (posted on current@) with close idea (I was creating extra geom with legacy name), and it will have the same problem: if somebody open any partition on the device with the new name, all legacy names will become inaccessible (busy), and vice versa. It could be not a big problem if it would only be user's choice -- we could say just: "use one or another, not both". But provider could be chosen blindly by some GEOM class, such as glabel, and then it turns into pure lottery. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 08:02:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9490C106564A; Tue, 26 Apr 2011 08:02:48 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C1C978FC15; Tue, 26 Apr 2011 08:02:47 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 3686945CBA; Tue, 26 Apr 2011 10:02:46 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 95B5445685; Tue, 26 Apr 2011 10:02:33 +0200 (CEST) Date: Tue, 26 Apr 2011 10:02:22 +0200 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110426080222.GG2472@garage.freebsd.pl> References: <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> <20110426073517.GF2472@garage.freebsd.pl> <4DB67939.6080301@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ahP6B03r4gLOj5uD" Content-Disposition: inline In-Reply-To: <4DB67939.6080301@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, "Bjoern A. Zeeb" , Robert Watson , svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 08:02:48 -0000 --ahP6B03r4gLOj5uD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 10:50:17AM +0300, Alexander Motin wrote: > On 26.04.2011 10:35, Pawel Jakub Dawidek wrote: > >On Tue, Apr 26, 2011 at 10:19:55AM +0300, Alexander Motin wrote: > >>On 26.04.2011 10:00, Pawel Jakub Dawidek wrote: > >>>On Mon, Apr 25, 2011 at 08:34:33PM +0300, Alexander Motin wrote: > >>>>I've thought about the process of fixing hardcoded provider names the= re, > >>>>and it is absolutely not trivial. If we take the "symlinking" way (pa= tch > >>>>is already posted to current@), I think it will be much easier for > >>>>everybody, and especially users, if I hack all mentioned above GEOM > >>>>classes to ignore adX/adaY difference in provider names. And it should > >>>>perfectly fit into remaining time window. > >>> > >>>Could you be more specific what the hack would do exactly? > >> > >>I would write some comparison function, which would search both > >>names for adX/adaY prefixes, if they found on both arguments, > >>trimmed them and compared remaining parts. > >> > >>I think for usual purpose of name hardcoding device name part is > >>less important. Comparing partition names part should be enough. The > >>tricky part there is to properly identify device part, so I was > >>thinking about specific hack for adX/adaY. > > > >I was wondering how would you match X and Y, but this is indeed not > >important. So on taste we could do (totally untested): > > > >static bool > >provider_name_matches(const char *ppname, const char *hcname) > >{ > > > > if (strcmp(ppname, hcname) =3D=3D 0) > > return (true); > > if (strncmp(hcname, "ad", 2) !=3D 0 || > > hcname[2]< '0' || hcname[2]> '9') { > > return (false); > > } > > if (strncmp(ppname, "ada", 3) !=3D 0 || > > ppname[3]< '0' || ppname[3]> '9') { > > return (false); > > } > > /* Skip 'ad[0-9]+'. */ > > hcname +=3D 3; > > while (hcname[0]>=3D '0'&& hcname[0]<=3D '9') > > hcname++; > > /* Skip 'ada[0-9]+'. > > ppname +=3D 4; > > while (ppname[0]>=3D '0'&& ppname[0]<=3D '9') > > ppname++; > > > > return (strcmp(ppname, hcname) =3D=3D 0); > >} > > > >That could work. >=20 > Yes, I was thinking about something like that. May be just > symmetric, so it could handle some cases of downgrade. Ok, so this will handle hardcoded provider names. I think this is good enough. Now, what about fstab? There is a problem to figure out which disk we booted from once we enter the kernel. I was wondering if we could detect that someone is trying to mount root which from 'ad[0-9]+' and then we could scan all ada[0-9]+ looking for UFS file system and /etc/fstab in there and / entry which matches vfs.root.mountfrom variable. This should cover 99% of cases. 1% is for cases where another disk have identical partitioning scheme and /etc/fstab file. There also might be cases where someone defines vfs.root.mountfrom in /boot/loader.conf and doesn't really use /etc/fstab. > >Another possibility I was thinking of was to create GEOM providers for > >both names and orphan the other name once one of them is opened for > >writing. >=20 > I've even implemented patch (posted on current@) with close idea (I > was creating extra geom with legacy name), and it will have the same > problem: if somebody open any partition on the device with the new > name, all legacy names will become inaccessible (busy), and vice > versa. It could be not a big problem if it would only be user's > choice -- we could say just: "use one or another, not both". But > provider could be chosen blindly by some GEOM class, such as glabel, > and then it turns into pure lottery. Good point. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --ahP6B03r4gLOj5uD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22fA4ACgkQForvXbEpPzSVkgCg58FJFGH9t000FC0OxifMvnJ1 rWEAnRKfV9yeHHuQpVbqpInURY8T6tHj =vyDX -----END PGP SIGNATURE----- --ahP6B03r4gLOj5uD-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 08:18:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3912110657DA; Tue, 26 Apr 2011 08:18:12 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0C5B18FC14; Tue, 26 Apr 2011 08:18:10 +0000 (UTC) Received: by bwz12 with SMTP id 12so462161bwz.13 for ; Tue, 26 Apr 2011 01:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=FAv74fmn2EjrrM6XiV5R97GKWQuJzn2imGOfiq9kf5s=; b=svpNafyc6iq8QDD7owZtGiDAMyg6h4NYj3EUxHvT2tjqZJiK1uTz/zKF08MidZWkU0 KpXxn/RFmeC4B+9zPWREx0rjszY3mKVfahyytmr0Rbb70RlQdKlSPNYnkwyxkPBsMJNj 1pNzxHKkKf2dK8mfIKSnEsb8ajXt1+I2HZu9I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=hNdxK36uObiLZjAHXChmaZ4sLShTesyTn1Dk4DExVZY8VkZ+lGEMrpL0BspStO1Jhq dN/e8opvmtEjt6gE4IHAzbKuBRNeGSm2SKMwRqrquPeNFKhzoH3kicF/Dzv/hFG9Q3WU ynpY0TF5kc3hl/kOHoz9/hjZuIGjZ15gb9/3A= Received: by 10.204.20.74 with SMTP id e10mr408559bkb.148.1303805889802; Tue, 26 Apr 2011 01:18:09 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id l1sm3701423bkl.1.2011.04.26.01.18.08 (version=SSLv3 cipher=OTHER); Tue, 26 Apr 2011 01:18:09 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB67FBE.1050707@FreeBSD.org> Date: Tue, 26 Apr 2011 11:18:06 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <20110425134531.GA4391@garage.freebsd.pl> <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> <20110426073517.GF2472@garage.freebsd.pl> <4DB67939.6080301@FreeBSD.org> <20110426080222.GG2472@garage.freebsd.pl> In-Reply-To: <20110426080222.GG2472@garage.freebsd.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 08:18:12 -0000 On 26.04.2011 11:02, Pawel Jakub Dawidek wrote: > Now, what about fstab? There is a problem to figure out which disk we > booted from once we enter the kernel. I was wondering if we could detect > that someone is trying to mount root which from 'ad[0-9]+' and > then we could scan all ada[0-9]+ looking for UFS file system and > /etc/fstab in there and / entry which matches vfs.root.mountfrom variable. > This should cover 99% of cases. 1% is for cases where another disk have > identical partitioning scheme and /etc/fstab file. There also might be > cases where someone defines vfs.root.mountfrom in /boot/loader.conf and > doesn't really use /etc/fstab. I think it will be unpredictable. Many disks may have s1a and especially s1d. What do you think about this: http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901 ? I've found that zpool utility don't likes symbolic links, but except this and together with fixing hardcoding problem IMHO it looks not bad. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 08:34:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A30106564A; Tue, 26 Apr 2011 08:34:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 4D3348FC0C; Tue, 26 Apr 2011 08:34:49 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id DA2F145EEB; Tue, 26 Apr 2011 10:34:47 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id BA01B45E49; Tue, 26 Apr 2011 10:34:41 +0200 (CEST) Date: Tue, 26 Apr 2011 10:34:31 +0200 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110426083431.GH2472@garage.freebsd.pl> References: <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> <20110426073517.GF2472@garage.freebsd.pl> <4DB67939.6080301@FreeBSD.org> <20110426080222.GG2472@garage.freebsd.pl> <4DB67FBE.1050707@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8/pVXlBMPtxfSuJG" Content-Disposition: inline In-Reply-To: <4DB67FBE.1050707@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 08:34:50 -0000 --8/pVXlBMPtxfSuJG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 11:18:06AM +0300, Alexander Motin wrote: > What do you think about this: > http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901 > ? I've found that zpool utility don't likes symbolic links, but > except this and together with fixing hardcoding problem IMHO it > looks not bad. It does look good, indeed. What's the problem with zpool? It should operate on GEOM providers only. Also, ZFS should not be affected by providers name changes. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --8/pVXlBMPtxfSuJG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22g5cACgkQForvXbEpPzShdwCfdNSgL3IOMecww/KhKg6N6KNV 0ZsAoN5/r9tTzkYfG+BkUq6v8BShhI4t =NLzj -----END PGP SIGNATURE----- --8/pVXlBMPtxfSuJG-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 08:45:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79150106566C; Tue, 26 Apr 2011 08:45:42 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 391038FC08; Tue, 26 Apr 2011 08:45:41 +0000 (UTC) Received: by bwz12 with SMTP id 12so481016bwz.13 for ; Tue, 26 Apr 2011 01:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=uYjrS0uU6MtwCIt4RJnPJKLy0nlOtNUOHKUPg3DbCd0=; b=Vv2rpO076J8q9muhMUhJ+a6T0iGOSc6nOxBAC+p4Hv7WG1JQdh+traOinRt+FpKIb8 wmuoqGJtIM1I/07oG3KFTLwvFyXVx3vr+N9xGAOBNfMU6TCwlbLvGhUo5TdVxAwdo7C1 BtL7K1b0JpYPrfqywAH0iBfSn/Knrkr5jG8yE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=JYi6VEuLNNB9lgbF/zf0r9uxM5vJCrboxOtEbruwb3LrT2+hEqhEiPHgBMMwaJabzn HL1rEzUiKrM4xTSpjL86jgzvAHOXnynhodJMDOjrRjrtVDry0i4uHekgbja+rs9u4BZE phCZk6/qXNvfrrI+d4qc4lMRu7KwfwB7pntW0= Received: by 10.204.20.142 with SMTP id f14mr431274bkb.155.1303807540148; Tue, 26 Apr 2011 01:45:40 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id d11sm54047bka.7.2011.04.26.01.45.38 (version=SSLv3 cipher=OTHER); Tue, 26 Apr 2011 01:45:39 -0700 (PDT) Sender: Alexander Motin Message-ID: <4DB68631.7070201@FreeBSD.org> Date: Tue, 26 Apr 2011 11:45:37 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110310 Thunderbird/3.1.9 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <50385B7B-7EC8-4BC3-8F88-83F9EB4096FB@bsdimp.com> <4DB5A166.9010302@FreeBSD.org> <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> <20110426073517.GF2472@garage.freebsd.pl> <4DB67939.6080301@FreeBSD.org> <20110426080222.GG2472@garage.freebsd.pl> <4DB67FBE.1050707@FreeBSD.org> <20110426083431.GH2472@garage.freebsd.pl> In-Reply-To: <20110426083431.GH2472@garage.freebsd.pl> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 08:45:42 -0000 On 26.04.2011 11:34, Pawel Jakub Dawidek wrote: > On Tue, Apr 26, 2011 at 11:18:06AM +0300, Alexander Motin wrote: >> What do you think about this: >> http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901 >> ? I've found that zpool utility don't likes symbolic links, but >> except this and together with fixing hardcoding problem IMHO it >> looks not bad. > > It does look good, indeed. > > What's the problem with zpool? make_dev_alias() creates symlink to the original device. After that, attempt to do `zpool create test /dev/ad12 /dev/ad13` fails. May be because it doesn't resolve symlink and can't find geom with name ad12. > It should operate on GEOM providers only. OK. If `zpool create` is the only possible problem there, then I think we can live with it. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 08:59:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B141065672; Tue, 26 Apr 2011 08:59:45 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 84A8B8FC14; Tue, 26 Apr 2011 08:59:44 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id A6D6645E5C; Tue, 26 Apr 2011 10:59:43 +0200 (CEST) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 561384569A; Tue, 26 Apr 2011 10:59:38 +0200 (CEST) Date: Tue, 26 Apr 2011 10:59:27 +0200 From: Pawel Jakub Dawidek To: Alexander Motin Message-ID: <20110426085927.GI2472@garage.freebsd.pl> References: <67F62848-FAA3-4C46-A95A-DA7C82281898@bsdimp.com> <4DB5B0A9.4030805@FreeBSD.org> <20110426070020.GC2472@garage.freebsd.pl> <4DB6721B.3020600@FreeBSD.org> <20110426073517.GF2472@garage.freebsd.pl> <4DB67939.6080301@FreeBSD.org> <20110426080222.GG2472@garage.freebsd.pl> <4DB67FBE.1050707@FreeBSD.org> <20110426083431.GH2472@garage.freebsd.pl> <4DB68631.7070201@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="G3juXO9GfR42w+sw" Content-Disposition: inline In-Reply-To: <4DB68631.7070201@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00, RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r220982 - in head: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/mips/conf sys/mips/malta sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 08:59:45 -0000 --G3juXO9GfR42w+sw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 11:45:37AM +0300, Alexander Motin wrote: > On 26.04.2011 11:34, Pawel Jakub Dawidek wrote: > >On Tue, Apr 26, 2011 at 11:18:06AM +0300, Alexander Motin wrote: > >>What do you think about this: > >>http://docs.freebsd.org/cgi/mid.cgi?4DB54BA9.5050901 > >>? I've found that zpool utility don't likes symbolic links, but > >>except this and together with fixing hardcoding problem IMHO it > >>looks not bad. > > > >It does look good, indeed. > > > >What's the problem with zpool? >=20 > make_dev_alias() creates symlink to the original device. After that, > attempt to do `zpool create test /dev/ad12 /dev/ad13` fails. May be > because it doesn't resolve symlink and can't find geom with name > ad12. IIRC zpool go straight to GEOM providers and doesn't even look into /dev/. Feel free to ignore this issue. Actually I think it is even better as people will notice that they should not use legacy names. > >It should operate on GEOM providers only. >=20 > OK. If `zpool create` is the only possible problem there, then I > think we can live with it. I agree. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --G3juXO9GfR42w+sw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk22iW8ACgkQForvXbEpPzT+pACgmXU9mWJbWuNJikB4baiOn6lY 5RwAoIswFmqHTtCvQlviZ0cG1wDmW93S =DDCS -----END PGP SIGNATURE----- --G3juXO9GfR42w+sw-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 09:57:22 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 226D9106566B; Tue, 26 Apr 2011 09:57:22 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from gse-mta-27.emailfiltering.com (gse-mta-27-tx.emailfiltering.com [194.116.198.158]) by mx1.freebsd.org (Postfix) with ESMTP id 363C38FC0C; Tue, 26 Apr 2011 09:57:20 +0000 (UTC) Received: from mail-gw14.york.ac.uk ([144.32.129.164]) by gse-mta-27.emailfiltering.com with emfmta (version 4.8.1.33) by TLS id 982575672 for obrien@FreeBSD.org; a659cf463e8734f8; Tue, 26 Apr 2011 10:57:20 +0100 Received: from buffy-128.york.ac.uk ([144.32.128.160]:11577 helo=buffy.york.ac.uk) by mail-gw14.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QEf1D-00060Z-Az; Tue, 26 Apr 2011 10:57:19 +0100 Received: from buffy.york.ac.uk (localhost [127.0.0.1]) by buffy.york.ac.uk (8.14.4/8.14.4) with ESMTP id p3Q9vI9Q050229; Tue, 26 Apr 2011 10:57:18 +0100 (BST) (envelope-from gavin@FreeBSD.org) Received: (from ga9@localhost) by buffy.york.ac.uk (8.14.4/8.14.4/Submit) id p3Q9vIvr050221; Tue, 26 Apr 2011 10:57:18 +0100 (BST) (envelope-from gavin@FreeBSD.org) X-Authentication-Warning: buffy.york.ac.uk: ga9 set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson To: "David E. O'Brien" In-Reply-To: <201104260409.p3Q49KaJ006272@svn.freebsd.org> References: <201104260409.p3Q49KaJ006272@svn.freebsd.org> Content-Type: text/plain; charset="ASCII" Content-Transfer-Encoding: quoted-printable Date: Tue, 26 Apr 2011 10:57:15 +0100 Message-ID: <1303811835.49968.6.camel@buffy.york.ac.uk> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r221053 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 09:57:22 -0000 On Tue, 2011-04-26 at 04:09 +0000, David E. O'Brien wrote: > Author: obrien > Date: Tue Apr 26 04:09:20 2011 > New Revision: 221053 > URL: http://svn.freebsd.org/changeset/base/221053 >=20 > Log: > This builds OK using the parent dir's WARNS=3D6. > [built on both AMD64 and i386] As a general rule, just compiling on i386 and amd64 are not sufficient to test WARNS bumps. It's usually sufficient to also crossbuild to a platform like sparc64 which has stricter alignment, but for a full test a "make universe" is best, as this will also catch other issues (for example arm, where char is unsigned). Thanks, Gavin --=20 Gavin Atkinson FreeBSD committer and bugmeister GPG: A093262B (313A A79F 697D 3A5C 216A EDF5 935D EF44 A093 262B) From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 11:39:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BBB71065672; Tue, 26 Apr 2011 11:39:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 616478FC08; Tue, 26 Apr 2011 11:39:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QBduuU020822; Tue, 26 Apr 2011 11:39:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QBduVx020817; Tue, 26 Apr 2011 11:39:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201104261139.p3QBduVx020817@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 26 Apr 2011 11:39:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221059 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 11:39:56 -0000 Author: kib Date: Tue Apr 26 11:39:56 2011 New Revision: 221059 URL: http://svn.freebsd.org/changeset/base/221059 Log: Implement the delayed task execution extension to the taskqueue mechanism. The caller may specify a timeout in ticks after which the task will be scheduled. Sponsored by: The FreeBSD Foundation Reviewed by: jeff, jhb MFC after: 1 month Added: head/sys/sys/_callout.h - copied, changed from r221058, head/sys/sys/callout.h Modified: head/sys/kern/subr_taskqueue.c head/sys/sys/callout.h head/sys/sys/taskqueue.h Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Tue Apr 26 10:02:15 2011 (r221058) +++ head/sys/kern/subr_taskqueue.c Tue Apr 26 11:39:56 2011 (r221059) @@ -61,12 +61,15 @@ struct taskqueue { int tq_tcount; int tq_spin; int tq_flags; + int tq_callouts; }; #define TQ_FLAGS_ACTIVE (1 << 0) #define TQ_FLAGS_BLOCKED (1 << 1) #define TQ_FLAGS_PENDING (1 << 2) +#define DT_CALLOUT_ARMED (1 << 0) + #define TQ_LOCK(tq) \ do { \ if ((tq)->tq_spin) \ @@ -83,6 +86,17 @@ struct taskqueue { mtx_unlock(&(tq)->tq_mutex); \ } while (0) +void +_timeout_task_init(struct taskqueue *queue, struct timeout_task *timeout_task, + int priority, task_fn_t func, void *context) +{ + + TASK_INIT(&timeout_task->t, priority, func, context); + callout_init_mtx(&timeout_task->c, &queue->tq_mutex, 0); + timeout_task->q = queue; + timeout_task->f = 0; +} + static __inline int TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, int t) @@ -129,7 +143,7 @@ static void taskqueue_terminate(struct thread **pp, struct taskqueue *tq) { - while (tq->tq_tcount > 0) { + while (tq->tq_tcount > 0 || tq->tq_callouts > 0) { wakeup(tq); TQ_SLEEP(tq, pp, &tq->tq_mutex, PWAIT, "taskqueue_destroy", 0); } @@ -143,26 +157,24 @@ taskqueue_free(struct taskqueue *queue) queue->tq_flags &= ~TQ_FLAGS_ACTIVE; taskqueue_terminate(queue->tq_threads, queue); KASSERT(TAILQ_EMPTY(&queue->tq_active), ("Tasks still running?")); + KASSERT(queue->tq_callouts == 0, ("Armed timeout tasks")); mtx_destroy(&queue->tq_mutex); free(queue->tq_threads, M_TASKQUEUE); free(queue, M_TASKQUEUE); } -int -taskqueue_enqueue(struct taskqueue *queue, struct task *task) +static int +taskqueue_enqueue_locked(struct taskqueue *queue, struct task *task) { struct task *ins; struct task *prev; - TQ_LOCK(queue); - /* * Count multiple enqueues. */ if (task->ta_pending) { task->ta_pending++; - TQ_UNLOCK(queue); - return 0; + return (0); } /* @@ -190,9 +202,60 @@ taskqueue_enqueue(struct taskqueue *queu else queue->tq_flags |= TQ_FLAGS_PENDING; + return (0); +} +int +taskqueue_enqueue(struct taskqueue *queue, struct task *task) +{ + int res; + + TQ_LOCK(queue); + res = taskqueue_enqueue_locked(queue, task); TQ_UNLOCK(queue); - return 0; + return (res); +} + +static void +taskqueue_timeout_func(void *arg) +{ + struct taskqueue *queue; + struct timeout_task *timeout_task; + + timeout_task = arg; + queue = timeout_task->q; + KASSERT((timeout_task->f & DT_CALLOUT_ARMED) != 0, ("Stray timeout")); + timeout_task->f &= ~DT_CALLOUT_ARMED; + queue->tq_callouts--; + taskqueue_enqueue_locked(timeout_task->q, &timeout_task->t); +} + +int +taskqueue_enqueue_timeout(struct taskqueue *queue, + struct timeout_task *timeout_task, int ticks) +{ + int res; + + TQ_LOCK(queue); + KASSERT(timeout_task->q == NULL || timeout_task->q == queue, + ("Migrated queue")); + KASSERT(!queue->tq_spin, ("Timeout for spin-queue")); + timeout_task->q = queue; + res = timeout_task->t.ta_pending; + if (ticks == 0) { + taskqueue_enqueue_locked(queue, &timeout_task->t); + } else { + if ((timeout_task->f & DT_CALLOUT_ARMED) != 0) { + res++; + } else { + queue->tq_callouts++; + timeout_task->f |= DT_CALLOUT_ARMED; + } + callout_reset(&timeout_task->c, ticks, taskqueue_timeout_func, + timeout_task); + } + TQ_UNLOCK(queue); + return (res); } void @@ -271,6 +334,19 @@ task_is_running(struct taskqueue *queue, return (0); } +static int +taskqueue_cancel_locked(struct taskqueue *queue, struct task *task, + u_int *pendp) +{ + + if (task->ta_pending > 0) + STAILQ_REMOVE(&queue->tq_queue, task, task, ta_link); + if (pendp != NULL) + *pendp = task->ta_pending; + task->ta_pending = 0; + return (task_is_running(queue, task) ? EBUSY : 0); +} + int taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp) { @@ -278,14 +354,31 @@ taskqueue_cancel(struct taskqueue *queue int error; TQ_LOCK(queue); - if ((pending = task->ta_pending) > 0) - STAILQ_REMOVE(&queue->tq_queue, task, task, ta_link); - task->ta_pending = 0; - error = task_is_running(queue, task) ? EBUSY : 0; + pending = task->ta_pending; + error = taskqueue_cancel_locked(queue, task, pendp); + TQ_UNLOCK(queue); + + return (error); +} + +int +taskqueue_cancel_timeout(struct taskqueue *queue, + struct timeout_task *timeout_task, u_int *pendp) +{ + u_int pending, pending1; + int error; + + TQ_LOCK(queue); + pending = !!callout_stop(&timeout_task->c); + error = taskqueue_cancel_locked(queue, &timeout_task->t, &pending1); + if ((timeout_task->f & DT_CALLOUT_ARMED) != 0) { + timeout_task->f &= ~DT_CALLOUT_ARMED; + queue->tq_callouts--; + } TQ_UNLOCK(queue); if (pendp != NULL) - *pendp = pending; + *pendp = pending + pending1; return (error); } @@ -302,6 +395,15 @@ taskqueue_drain(struct taskqueue *queue, TQ_UNLOCK(queue); } +void +taskqueue_drain_timeout(struct taskqueue *queue, + struct timeout_task *timeout_task) +{ + + callout_drain(&timeout_task->c); + taskqueue_drain(queue, &timeout_task->t); +} + static void taskqueue_swi_enqueue(void *context) { Copied and modified: head/sys/sys/_callout.h (from r221058, head/sys/sys/callout.h) ============================================================================== --- head/sys/sys/callout.h Tue Apr 26 10:02:15 2011 (r221058, copy source) +++ head/sys/sys/_callout.h Tue Apr 26 11:39:56 2011 (r221059) @@ -35,8 +35,8 @@ * $FreeBSD$ */ -#ifndef _SYS_CALLOUT_H_ -#define _SYS_CALLOUT_H_ +#ifndef _SYS__CALLOUT_H +#define _SYS__CALLOUT_H #include @@ -58,47 +58,4 @@ struct callout { volatile int c_cpu; /* CPU we're scheduled on */ }; -#define CALLOUT_LOCAL_ALLOC 0x0001 /* was allocated from callfree */ -#define CALLOUT_ACTIVE 0x0002 /* callout is currently active */ -#define CALLOUT_PENDING 0x0004 /* callout is waiting for timeout */ -#define CALLOUT_MPSAFE 0x0008 /* callout handler is mp safe */ -#define CALLOUT_RETURNUNLOCKED 0x0010 /* handler returns with mtx unlocked */ -#define CALLOUT_SHAREDLOCK 0x0020 /* callout lock held in shared mode */ - -struct callout_handle { - struct callout *callout; -}; - -#ifdef _KERNEL -extern int ncallout; - -#define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) -#define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) -#define callout_drain(c) _callout_stop_safe(c, 1) -void callout_init(struct callout *, int); -void _callout_init_lock(struct callout *, struct lock_object *, int); -#define callout_init_mtx(c, mtx, flags) \ - _callout_init_lock((c), ((mtx) != NULL) ? &(mtx)->lock_object : \ - NULL, (flags)) -#define callout_init_rw(c, rw, flags) \ - _callout_init_lock((c), ((rw) != NULL) ? &(rw)->lock_object : \ - NULL, (flags)) -#define callout_pending(c) ((c)->c_flags & CALLOUT_PENDING) -int callout_reset_on(struct callout *, int, void (*)(void *), void *, int); -#define callout_reset(c, on_tick, fn, arg) \ - callout_reset_on((c), (on_tick), (fn), (arg), (c)->c_cpu) -#define callout_reset_curcpu(c, on_tick, fn, arg) \ - callout_reset_on((c), (on_tick), (fn), (arg), PCPU_GET(cpuid)) -int callout_schedule(struct callout *, int); -int callout_schedule_on(struct callout *, int, int); -#define callout_schedule_curcpu(c, on_tick) \ - callout_schedule_on((c), (on_tick), PCPU_GET(cpuid)) -#define callout_stop(c) _callout_stop_safe(c, 0) -int _callout_stop_safe(struct callout *, int); -void callout_tick(void); -int callout_tickstofirst(int limit); -extern void (*callout_new_inserted)(int cpu, int ticks); - #endif - -#endif /* _SYS_CALLOUT_H_ */ Modified: head/sys/sys/callout.h ============================================================================== --- head/sys/sys/callout.h Tue Apr 26 10:02:15 2011 (r221058) +++ head/sys/sys/callout.h Tue Apr 26 11:39:56 2011 (r221059) @@ -38,25 +38,7 @@ #ifndef _SYS_CALLOUT_H_ #define _SYS_CALLOUT_H_ -#include - -struct lock_object; - -SLIST_HEAD(callout_list, callout); -TAILQ_HEAD(callout_tailq, callout); - -struct callout { - union { - SLIST_ENTRY(callout) sle; - TAILQ_ENTRY(callout) tqe; - } c_links; - int c_time; /* ticks to the event */ - void *c_arg; /* function argument */ - void (*c_func)(void *); /* function to call */ - struct lock_object *c_lock; /* lock to handle */ - int c_flags; /* state of this entry */ - volatile int c_cpu; /* CPU we're scheduled on */ -}; +#include #define CALLOUT_LOCAL_ALLOC 0x0001 /* was allocated from callfree */ #define CALLOUT_ACTIVE 0x0002 /* callout is currently active */ Modified: head/sys/sys/taskqueue.h ============================================================================== --- head/sys/sys/taskqueue.h Tue Apr 26 10:02:15 2011 (r221058) +++ head/sys/sys/taskqueue.h Tue Apr 26 11:39:56 2011 (r221059) @@ -35,10 +35,18 @@ #include #include +#include struct taskqueue; struct thread; +struct timeout_task { + struct taskqueue *q; + struct task t; + struct callout c; + int f; +}; + /* * A notification callback function which is called from * taskqueue_enqueue(). The context argument is given in the call to @@ -54,9 +62,15 @@ struct taskqueue *taskqueue_create(const int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, const char *name, ...) __printflike(4, 5); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); +int taskqueue_enqueue_timeout(struct taskqueue *queue, + struct timeout_task *timeout_task, int ticks); int taskqueue_cancel(struct taskqueue *queue, struct task *task, u_int *pendp); +int taskqueue_cancel_timeout(struct taskqueue *queue, + struct timeout_task *timeout_task, u_int *pendp); void taskqueue_drain(struct taskqueue *queue, struct task *task); +void taskqueue_drain_timeout(struct taskqueue *queue, + struct timeout_task *timeout_task); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); @@ -79,6 +93,12 @@ void taskqueue_thread_enqueue(void *cont (task)->ta_context = (context); \ } while (0) +void _timeout_task_init(struct taskqueue *queue, + struct timeout_task *timeout_task, int priority, task_fn_t func, + void *context); +#define TIMEOUT_TASK_INIT(queue, timeout_task, priority, func, context) \ + _timeout_task_init(queue, timeout_task, priority, func, context); + /* * Declare a reference to a taskqueue. */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 11:43:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280B8106564A; Tue, 26 Apr 2011 11:43:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E56F8FC17; Tue, 26 Apr 2011 11:43:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QBhvsY020994; Tue, 26 Apr 2011 11:43:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QBhvQ2020992; Tue, 26 Apr 2011 11:43:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201104261143.p3QBhvQ2020992@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 26 Apr 2011 11:43:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221060 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 11:43:58 -0000 Author: kib Date: Tue Apr 26 11:43:57 2011 New Revision: 221060 URL: http://svn.freebsd.org/changeset/base/221060 Log: Document timeout_task. While there, fix the type of the func argument of INIT_TASK macro, and use the modern name of the analogous facility from Linux kernel. Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/share/man/man9/taskqueue.9 Modified: head/share/man/man9/taskqueue.9 ============================================================================== --- head/share/man/man9/taskqueue.9 Tue Apr 26 11:39:56 2011 (r221059) +++ head/share/man/man9/taskqueue.9 Tue Apr 26 11:43:57 2011 (r221060) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2009 +.Dd April 26, 2011 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -52,6 +52,8 @@ struct task { task_fn_t ta_func; /* task handler */ void *ta_context; /* argument for handler */ }; + +struct timeout_task; .Ed .Ft struct taskqueue * .Fn taskqueue_create "const char *name" "int mflags" "taskqueue_enqueue_fn enqueue" "void *context" @@ -64,19 +66,26 @@ struct task { .Ft int .Fn taskqueue_enqueue_fast "struct taskqueue *queue" "struct task *task" .Ft int +.Fn taskqueue_enqueue_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" "int ticks" +.Ft int .Fn taskqueue_cancel "struct taskqueue *queue" "struct task *task" "u_int *pendp" +.Ft int +.Fn taskqueue_cancel_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" "u_int *pendp" .Ft void .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" +.Ft void +.Fn taskqueue_drain_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Ft void .Fn taskqueue_run "struct taskqueue *queue" -.Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" +.Fn TASK_INIT "struct task *task" "int priority" "task_fn_t func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" .Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" .Fn TASKQUEUE_DEFINE_THREAD "name" .Fn TASKQUEUE_FAST_DEFINE_THREAD "name" +.Fn TIMEOUT_TASK_INIT "struct taskqueue *queue" "struct timeout_task *timeout_task" "int priority" "task_fn_t func" "void *context" .Sh DESCRIPTION These functions provide a simple interface for asynchronous execution of code. @@ -164,6 +173,14 @@ is called on the task pointer passed to .Fn taskqueue_enqueue . .Pp The +.Fn taskqueue_enqueue_timeout +is used to schedule the enqueue after the specified amount of +.Va ticks . +Only non-fast task queues can be used for +.Va timeout_task +scheduling. +.Pp +The .Fn taskqueue_cancel function is used to cancel a task. The @@ -188,9 +205,16 @@ Note that, as with the caller is responsible for ensuring that the task is not re-enqueued after being canceled. .Pp +Similarly, the +.Fn taskqueue_cancel_timeout +function is used to cancel the scheduled task execution. +.Pp The .Fn taskqueue_drain -function is used to wait for the task to finish. +function is used to wait for the task to finish, and +the +.Fn taskqueue_drain_timeout +function is used to wait for the scheduled task to finish. There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . @@ -218,6 +242,9 @@ A convenience macro, is provided to initialise a .Va task structure. +A macro +.Fn TIMEOUT_TASK_INIT "queue" "timeout_task" "priority" "func" "context" +initializes the timeout_task structure. The values of .Va priority , .Va func , @@ -342,7 +369,7 @@ be created with a dedicated processing t .Sh HISTORY This interface first appeared in .Fx 5.0 . -There is a similar facility called tqueue in the Linux kernel. +There is a similar facility called work_queue in the Linux kernel. .Sh AUTHORS This manual page was written by .An Doug Rabson . From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 11:53:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5488106566C; Tue, 26 Apr 2011 11:53:41 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 371208FC21; Tue, 26 Apr 2011 11:53:40 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3QBrXHh044755 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 26 Apr 2011 14:53:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p3QBrXV1028952; Tue, 26 Apr 2011 14:53:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3QBrXFp028951; Tue, 26 Apr 2011 14:53:33 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 26 Apr 2011 14:53:33 +0300 From: Kostik Belousov To: Hans Petter Selasky Message-ID: <20110426115333.GP48734@deviant.kiev.zoral.com.ua> References: <201104261139.p3QBduVx020817@svn.freebsd.org> <201104261344.00551.hselasky@c2i.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ct8ez/PVgO98mXV4" Content-Disposition: inline In-Reply-To: <201104261344.00551.hselasky@c2i.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r221059 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 11:53:41 -0000 --ct8ez/PVgO98mXV4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2011 at 01:44:00PM +0200, Hans Petter Selasky wrote: > On Tuesday 26 April 2011 13:39:56 Konstantin Belousov wrote: > > + pending =3D !!callout_stop(&timeout_task->c); >=20 > pending =3D (callout_stop(&timeout_task->c) !=3D 0); >=20 > ? This line is about conversion from a boolean value to {0, 1} value set. If !! construct does not look stylish, then wouldn't we need to go with pending =3D (callout_stop(&timeout_task->c) !=3D 0) ? 1 : 0; instead ? Feel free to adjust whatever variant you prefer and commit it. --ct8ez/PVgO98mXV4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk22sj0ACgkQC3+MBN1Mb4ggfQCgrvHcDN6+1Y8WuU04AIfPN5oH rxcAn33A6RRjpgu/pRYwVZKSbeNc3H9f =9Eou -----END PGP SIGNATURE----- --ct8ez/PVgO98mXV4-- From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 11:55:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C832C106564A; Tue, 26 Apr 2011 11:55:10 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id 1FFEE8FC12; Tue, 26 Apr 2011 11:55:09 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=Vlw5OJcoxCC473z5moizI40ESYe+BpcMN2hU0iQoJwI= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=oArLlKAruIoA:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=RH0X6Hjl0PFd8RRinRsA:9 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mailfe01.swip.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.1 X-TFF-CGPSA-Version: 1.7 X-T2-CGPSA-Filter: Scanned Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 119119474; Tue, 26 Apr 2011 13:44:55 +0200 From: Hans Petter Selasky To: Konstantin Belousov Date: Tue, 26 Apr 2011 13:44:00 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201104261139.p3QBduVx020817@svn.freebsd.org> In-Reply-To: <201104261139.p3QBduVx020817@svn.freebsd.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201104261344.00551.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r221059 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 11:55:10 -0000 On Tuesday 26 April 2011 13:39:56 Konstantin Belousov wrote: > + pending = !!callout_stop(&timeout_task->c); pending = (callout_stop(&timeout_task->c) != 0); ? --HPS From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 12:08:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59143106566B; Tue, 26 Apr 2011 12:08:49 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.c2i.net [212.247.154.194]) by mx1.freebsd.org (Postfix) with ESMTP id 8D7AD8FC1C; Tue, 26 Apr 2011 12:08:48 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=118a5bn0tGnRZbUa9ClBty6BTuM1bA5mUZqmf2RHYp4= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=oArLlKAruIoA:10 a=WQU8e4WWZSUA:10 a=Q9fys5e9bTEA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=HVcOSVqeEClIJtUmUjUA:9 a=PUjeQqilurYA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe07.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 118551104; Tue, 26 Apr 2011 14:08:34 +0200 From: Hans Petter Selasky To: Kostik Belousov Date: Tue, 26 Apr 2011 14:07:31 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201104261139.p3QBduVx020817@svn.freebsd.org> <201104261344.00551.hselasky@c2i.net> <20110426115333.GP48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110426115333.GP48734@deviant.kiev.zoral.com.ua> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201104261407.31963.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r221059 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 12:08:49 -0000 On Tuesday 26 April 2011 13:53:33 Kostik Belousov wrote: > On Tue, Apr 26, 2011 at 01:44:00PM +0200, Hans Petter Selasky wrote: > > On Tuesday 26 April 2011 13:39:56 Konstantin Belousov wrote: > > > + pending = !!callout_stop(&timeout_task->c); > > > > pending = (callout_stop(&timeout_task->c) != 0); > > > > ? Hi, This is just a nit I noticed. > > This line is about conversion from a boolean value to {0, 1} value set. > If !! construct does not look stylish, then wouldn't we need to go > with > pending = (callout_stop(&timeout_task->c) != 0) ? 1 : 0; > instead ? The output from ! is already a boolean and "pending" is a u_int, so to be correct it should be similar to what you suggest. I'm not sure what case produce the less amount of code and which the compiler understands the best. Probably it does not matter that much. I was thinking that "!!" is depreceated, but "man style" is silent about it. > Feel free to adjust whatever variant you prefer and commit it. Ok. --HPS From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 13:32:46 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E97901065674; Tue, 26 Apr 2011 13:32:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BD79A8FC25; Tue, 26 Apr 2011 13:32:46 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 634DF46B45; Tue, 26 Apr 2011 09:32:46 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C1E5B8A02A; Tue, 26 Apr 2011 09:32:45 -0400 (EDT) From: John Baldwin To: "David E. O'Brien" Date: Tue, 26 Apr 2011 09:32:44 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <201104260409.p3Q49KaJ006272@svn.freebsd.org> In-Reply-To: <201104260409.p3Q49KaJ006272@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201104260932.44199.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 26 Apr 2011 09:32:45 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221053 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 13:32:47 -0000 On Tuesday, April 26, 2011 12:09:20 am David E. O'Brien wrote: > Author: obrien > Date: Tue Apr 26 04:09:20 2011 > New Revision: 221053 > URL: http://svn.freebsd.org/changeset/base/221053 > > Log: > This builds OK using the parent dir's WARNS=6. > [built on both AMD64 and i386] This breaks the tinderbox on at least arm, ia64, mips, and sparc64. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 13:37:48 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1659A106566C; Tue, 26 Apr 2011 13:37:48 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id C89698FC16; Tue, 26 Apr 2011 13:37:47 +0000 (UTC) Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3QDRBK5033584 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Tue, 26 Apr 2011 07:27:11 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <1303811835.49968.6.camel@buffy.york.ac.uk> Date: Tue, 26 Apr 2011 07:27:11 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <67269B04-5727-4B8D-B442-D93CD0CB0A61@bsdimp.com> References: <201104260409.p3Q49KaJ006272@svn.freebsd.org> <1303811835.49968.6.camel@buffy.york.ac.uk> To: Gavin Atkinson X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Tue, 26 Apr 2011 07:27:11 -0600 (MDT) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, "David E. O'Brien" Subject: Re: svn commit: r221053 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 13:37:48 -0000 On Apr 26, 2011, at 3:57 AM, Gavin Atkinson wrote: > On Tue, 2011-04-26 at 04:09 +0000, David E. O'Brien wrote: >> Author: obrien >> Date: Tue Apr 26 04:09:20 2011 >> New Revision: 221053 >> URL: http://svn.freebsd.org/changeset/base/221053 >>=20 >> Log: >> This builds OK using the parent dir's WARNS=3D6. >> [built on both AMD64 and i386] >=20 > As a general rule, just compiling on i386 and amd64 are not sufficient > to test WARNS bumps. It's usually sufficient to also crossbuild to a > platform like sparc64 which has stricter alignment, but for a full = test > a "make universe" is best, as this will also catch other issues (for > example arm, where char is unsigned). I read the test log as "not really tested, feel free to back it out if = it fails on a different architecture" :) Warner From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 13:50:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60EFC106566C; Tue, 26 Apr 2011 13:50:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 360608FC17; Tue, 26 Apr 2011 13:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QDoCKF025005; Tue, 26 Apr 2011 13:50:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QDoCnX025002; Tue, 26 Apr 2011 13:50:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201104261350.p3QDoCnX025002@svn.freebsd.org> From: Rick Macklem Date: Tue, 26 Apr 2011 13:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221066 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 13:50:12 -0000 Author: rmacklem Date: Tue Apr 26 13:50:11 2011 New Revision: 221066 URL: http://svn.freebsd.org/changeset/base/221066 Log: Fix a kernel linking problem introduced by r221032, r221040 when building kernels that don't have "options NFS_ROOT" specified. I plan on moving the functions that use these data structures into the shared code in sys/nfs/nfs_diskless.c in a future commit. At that time, these definitions will no longer be needed in nfs_vfsops.c and nfs_clvfsops.c. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Apr 26 13:09:54 2011 (r221065) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Tue Apr 26 13:50:11 2011 (r221066) @@ -137,10 +137,17 @@ VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK MODULE_VERSION(newnfs, 1); /* - * This structure must be filled in by a primary bootstrap or bootstrap - * server for a diskless/dataless machine. It is initialized below just - * to ensure that it is allocated to initialized data (.data not .bss). + * This structure is now defined in sys/nfs/nfs_diskless.c so that it + * can be shared by both NFS clients. It is declared here so that it + * will be defined for kernels built without NFS_ROOT, although it + * isn't used in that case. */ +#if !defined(NFS_ROOT) && !defined(NFSCLIENT) +struct nfs_diskless nfs_diskless = { { { 0 } } }; +struct nfsv3_diskless nfsv3_diskless = { { { 0 } } }; +int nfs_diskless_valid = 0; +#endif + SYSCTL_INT(_vfs_newnfs, OID_AUTO, diskless_valid, CTLFLAG_RD, &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Apr 26 13:09:54 2011 (r221065) +++ head/sys/nfsclient/nfs_vfsops.c Tue Apr 26 13:50:11 2011 (r221066) @@ -164,6 +164,18 @@ static struct nfs_rpcops nfs_rpcops = { nfs_commit, }; +/* + * This structure is now defined in sys/nfs/nfs_diskless.c so that it + * can be shared by both NFS clients. It is declared here so that it + * will be defined for kernels built without NFS_ROOT, although it + * isn't used in that case. + */ +#ifndef NFS_ROOT +struct nfs_diskless nfs_diskless = { { { 0 } } }; +struct nfsv3_diskless nfsv3_diskless = { { { 0 } } }; +int nfs_diskless_valid = 0; +#endif + SYSCTL_INT(_vfs_nfs, OID_AUTO, diskless_valid, CTLFLAG_RD, &nfs_diskless_valid, 0, "Has the diskless struct been filled correctly"); From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 16:14:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 858E41065670; Tue, 26 Apr 2011 16:14:55 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5979C8FC12; Tue, 26 Apr 2011 16:14:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QGEtCZ029388; Tue, 26 Apr 2011 16:14:55 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QGEtXx029386; Tue, 26 Apr 2011 16:14:55 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201104261614.p3QGEtXx029386@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 26 Apr 2011 16:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221069 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 16:14:55 -0000 Author: sobomax Date: Tue Apr 26 16:14:55 2011 New Revision: 221069 URL: http://svn.freebsd.org/changeset/base/221069 Log: With the typical memory size of the system in tenth of gigabytes counting memory being dumped in 16MB increments is somewhat silly. Especially if the dump fails and everything you've got for debugging is screen filled with numbers in 16 decrements... Replace that with percentage-based progress with max 10 updates all fitting into one line. Collapse other very "useful" piece of crash information (total ram) into the same line to save some more space. MFC after: 1 week Modified: head/sys/amd64/amd64/minidump_machdep.c Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Tue Apr 26 15:11:13 2011 (r221068) +++ head/sys/amd64/amd64/minidump_machdep.c Tue Apr 26 16:14:55 2011 (r221069) @@ -62,7 +62,7 @@ static off_t dumplo; /* Handle chunked writes. */ static size_t fragsz; static void *dump_va; -static size_t counter, progress; +static size_t counter, progress, dumpsize; CTASSERT(sizeof(*vm_page_dump) == 8); @@ -94,6 +94,40 @@ blk_flush(struct dumperinfo *di) return (error); } +static struct { + int min_per; + int max_per; + int visited; +} progress_track[10] = { + { 0, 10, 0}, + { 10, 20, 0}, + { 20, 30, 0}, + { 30, 40, 0}, + { 40, 50, 0}, + { 50, 60, 0}, + { 60, 70, 0}, + { 70, 80, 0}, + { 80, 90, 0}, + { 90, 100, 0} +}; + +static void +report_progress(size_t progress, size_t dumpsize) +{ + int sofar, i; + + sofar = 100 - ((progress * 100) / dumpsize); + for (i = 0; i < 10; i++) { + if (sofar < progress_track[i].min_per || sofar > progress_track[i].max_per) + continue; + if (progress_track[i].visited) + return; + progress_track[i].visited = 1; + printf("..%d%%", sofar); + return; + } +} + static int blk_write(struct dumperinfo *di, char *ptr, vm_paddr_t pa, size_t sz) { @@ -130,7 +164,7 @@ blk_write(struct dumperinfo *di, char *p counter += len; progress -= len; if (counter >> 24) { - printf(" %ld", PG2MB(progress >> PAGE_SHIFT)); + report_progress(progress, dumpsize); counter &= (1<<24) - 1; } if (ptr) { @@ -170,7 +204,6 @@ static pd_entry_t fakepd[NPDEPG]; void minidumpsys(struct dumperinfo *di) { - uint64_t dumpsize; uint32_t pmapsize; vm_offset_t va; int error; @@ -290,8 +323,8 @@ minidumpsys(struct dumperinfo *di) mkdumpheader(&kdh, KERNELDUMPMAGIC, KERNELDUMP_AMD64_VERSION, dumpsize, di->blocksize); - printf("Physical memory: %ju MB\n", ptoa((uintmax_t)physmem) / 1048576); - printf("Dumping %llu MB:", (long long)dumpsize >> 20); + printf("Dumping %llu out of %ju MB:", (long long)dumpsize >> 20, + ptoa((uintmax_t)physmem) / 1048576); /* Dump leader */ error = dump_write(di, &kdh, 0, dumplo, sizeof(kdh)); From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 17:01:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 955E2106566B; Tue, 26 Apr 2011 17:01:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 800258FC16; Tue, 26 Apr 2011 17:01:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QH1ntJ030905; Tue, 26 Apr 2011 17:01:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QH1ngd030888; Tue, 26 Apr 2011 17:01:49 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201104261701.p3QH1ngd030888@svn.freebsd.org> From: Alexander Motin Date: Tue, 26 Apr 2011 17:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221071 - in head: . sys/amd64/conf sys/arm/conf sys/cam sys/cam/ata sys/conf sys/geom sys/i386/conf sys/mips/conf sys/modules/cam sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 17:01:49 -0000 Author: mav Date: Tue Apr 26 17:01:49 2011 New Revision: 221071 URL: http://svn.freebsd.org/changeset/base/221071 Log: - Add shim to simplify migration to the CAM-based ATA. For each new adaX device in /dev/ create symbolic link with adY name, trying to mimic old ATA numbering. Imitation is not complete, but should be enough in most cases to mount file systems without touching /etc/fstab. - To know what behavior to mimic, restore ATA_STATIC_ID option in cases where it was present before. - Add some more details to UPDATING. Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/arm/conf/CRB head/sys/arm/conf/EP80219 head/sys/arm/conf/IQ31244 head/sys/cam/ata/ata_da.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt.h head/sys/conf/NOTES head/sys/geom/geom_dev.c head/sys/i386/conf/GENERIC head/sys/i386/conf/XBOX head/sys/mips/conf/OCTEON1 head/sys/mips/conf/std.SWARM head/sys/modules/cam/Makefile head/sys/pc98/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Tue Apr 26 16:56:43 2011 (r221070) +++ head/UPDATING Tue Apr 26 17:01:49 2011 (r221071) @@ -30,7 +30,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY, where 'Y's are the sequential numbers starting from zero for each type in order of detection, unless configured otherwise with tunables, - see cam(4)). + see cam(4)). There will be symbolic links created in /dev/ to map + old adX devices to the respective adaY. They should provide basic + compatibility for file systems mounting in most cases, but they do + not support old user-level APIs and do not have respective providers + in GEOM. Consider using updated management tools with new device names. + + It is possible to load devices ahci, ata, siis and mvs as modules, + but option ATA_CAM should remain in kernel configuration to make ata + module work as CAM driver supporting legacy ATA controllers. Device ata + still can be used in modular fashion (atacore + ...). Modules atadisk + and atapi* are not used and won't affect operation in ATA_CAM mode. ataraid(4) functionality is now supported by the RAID GEOM class. To use it you can load geom_raid kernel module and use graid(8) tool @@ -49,7 +59,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9. device atapicd # ATAPI CDROM drives device atapifd # ATAPI floppy drives device atapist # ATAPI tape drives - options ATA_STATIC_ID # Static device numbering 20110423: The default NFS server has been changed to the new server, which Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/amd64/conf/GENERIC Tue Apr 26 17:01:49 2011 (r221071) @@ -93,6 +93,7 @@ device fdc device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers options ATA_CAM # Handle legacy controllers with CAM +options ATA_STATIC_ID # Static device numbering device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/arm/conf/CRB Tue Apr 26 17:01:49 2011 (r221071) @@ -74,6 +74,7 @@ device pci device ata options ATA_CAM +options ATA_STATIC_ID # Static device numbering device scbus # SCSI bus (required for ATA/SCSI) device cd # CD Modified: head/sys/arm/conf/EP80219 ============================================================================== --- head/sys/arm/conf/EP80219 Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/arm/conf/EP80219 Tue Apr 26 17:01:49 2011 (r221071) @@ -74,6 +74,7 @@ device pci device ata options ATA_CAM +options ATA_STATIC_ID # Static device numbering device scbus # SCSI bus (required for ATA/SCSI) device cd # CD Modified: head/sys/arm/conf/IQ31244 ============================================================================== --- head/sys/arm/conf/IQ31244 Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/arm/conf/IQ31244 Tue Apr 26 17:01:49 2011 (r221071) @@ -73,6 +73,7 @@ device pci device ata options ATA_CAM +options ATA_STATIC_ID # Static device numbering device scbus # SCSI bus (required for ATA/SCSI) device cd # CD Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/cam/ata/ata_da.c Tue Apr 26 17:01:49 2011 (r221071) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ada.h" +#include "opt_ata.h" #include @@ -183,6 +184,14 @@ static void adashutdown(void *arg, int static void adasuspend(void *arg); static void adaresume(void *arg); +#ifndef ADA_DEFAULT_LEGACY_ALIASES +#ifdef ATA_CAM +#define ADA_DEFAULT_LEGACY_ALIASES 1 +#else +#define ADA_DEFAULT_LEGACY_ALIASES 0 +#endif +#endif + #ifndef ADA_DEFAULT_TIMEOUT #define ADA_DEFAULT_TIMEOUT 30 /* Timeout in seconds */ #endif @@ -215,6 +224,7 @@ static void adaresume(void *arg); #define ata_disk_firmware_geom_adjust(disk) #endif +static int ada_legacy_aliases = ADA_DEFAULT_LEGACY_ALIASES; static int ada_retry_count = ADA_DEFAULT_RETRY; static int ada_default_timeout = ADA_DEFAULT_TIMEOUT; static int ada_send_ordered = ADA_DEFAULT_SEND_ORDERED; @@ -224,6 +234,9 @@ static int ada_write_cache = ADA_DEFAULT SYSCTL_NODE(_kern_cam, OID_AUTO, ada, CTLFLAG_RD, 0, "CAM Direct Access Disk driver"); +SYSCTL_INT(_kern_cam_ada, OID_AUTO, legacy_aliases, CTLFLAG_RW, + &ada_legacy_aliases, 0, "Create legacy-like device aliases"); +TUNABLE_INT("kern.cam.ada.legacy_aliases", &ada_legacy_aliases); SYSCTL_INT(_kern_cam_ada, OID_AUTO, retry_count, CTLFLAG_RW, &ada_retry_count, 0, "Normal I/O retry count"); TUNABLE_INT("kern.cam.ada.retry_count", &ada_retry_count); @@ -723,10 +736,11 @@ adaregister(struct cam_periph *periph, v struct ada_softc *softc; struct ccb_pathinq cpi; struct ccb_getdev *cgd; - char announce_buf[80]; + char announce_buf[80], buf1[32]; struct disk_params *dp; caddr_t match; u_int maxio; + int legacy_id; cgd = (struct ccb_getdev *)arg; if (periph == NULL) { @@ -861,6 +875,22 @@ adaregister(struct cam_periph *periph, v softc->disk->d_fwheads = softc->params.heads; ata_disk_firmware_geom_adjust(softc->disk); + if (ada_legacy_aliases) { +#ifdef ATA_STATIC_ID + legacy_id = xpt_path_legacy_ata_id(periph->path); +#else + legacy_id = softc->disk->d_unit; +#endif + if (legacy_id >= 0) { + snprintf(announce_buf, sizeof(announce_buf), + "kern.devalias.%s%d", + softc->disk->d_name, softc->disk->d_unit); + snprintf(buf1, sizeof(buf1), + "ad%d", legacy_id); + setenv(announce_buf, buf1); + } + } else + legacy_id = -1; disk_create(softc->disk, DISK_VERSION); mtx_lock(periph->sim->mtx); cam_periph_unhold(periph); @@ -874,6 +904,9 @@ adaregister(struct cam_periph *periph, v dp->secsize, dp->heads, dp->secs_per_track, dp->cylinders); xpt_announce_periph(periph, announce_buf); + if (legacy_id >= 0) + printf("%s%d: Previously was known as ad%d\n", + periph->periph_name, periph->unit_number, legacy_id); /* * Create our sysctl variables, now that we know Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/cam/cam_xpt.c Tue Apr 26 17:01:49 2011 (r221071) @@ -3569,6 +3569,42 @@ xpt_path_periph(struct cam_path *path) return (path->periph); } +int +xpt_path_legacy_ata_id(struct cam_path *path) +{ + struct cam_eb *bus; + int bus_id; + + if ((strcmp(path->bus->sim->sim_name, "ata") != 0) && + strcmp(path->bus->sim->sim_name, "ahcich") != 0 && + strcmp(path->bus->sim->sim_name, "mvsch") != 0 && + strcmp(path->bus->sim->sim_name, "siisch") != 0) + return (-1); + + if (strcmp(path->bus->sim->sim_name, "ata") == 0 && + path->bus->sim->unit_number < 2) { + bus_id = path->bus->sim->unit_number; + } else { + bus_id = 2; + xpt_lock_buses(); + TAILQ_FOREACH(bus, &xsoftc.xpt_busses, links) { + if (bus == path->bus) + break; + if ((strcmp(bus->sim->sim_name, "ata") == 0 && + bus->sim->unit_number >= 2) || + strcmp(bus->sim->sim_name, "ahcich") == 0 || + strcmp(bus->sim->sim_name, "mvsch") == 0 || + strcmp(bus->sim->sim_name, "siisch") == 0) + bus_id++; + } + xpt_unlock_buses(); + } + if (path->target != NULL) + return (bus_id * 2 + path->target->target_id); + else + return (bus_id * 2); +} + /* * Release a CAM control block for the caller. Remit the cost of the structure * to the device referenced by the path. If the this device had no 'credits' Modified: head/sys/cam/cam_xpt.h ============================================================================== --- head/sys/cam/cam_xpt.h Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/cam/cam_xpt.h Tue Apr 26 17:01:49 2011 (r221071) @@ -113,6 +113,7 @@ int xpt_path_string(struct cam_path *p path_id_t xpt_path_path_id(struct cam_path *path); target_id_t xpt_path_target_id(struct cam_path *path); lun_id_t xpt_path_lun_id(struct cam_path *path); +int xpt_path_legacy_ata_id(struct cam_path *path); struct cam_sim *xpt_path_sim(struct cam_path *path); struct cam_periph *xpt_path_periph(struct cam_path *path); void xpt_async(u_int32_t async_code, struct cam_path *path, Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/conf/NOTES Tue Apr 26 17:01:49 2011 (r221071) @@ -1754,7 +1754,7 @@ hint.ata.1.irq="15" # atapifd, atapist, atapicam) and all user-level APIs. # cam(4) drivers and APIs will be connected instead. -#options ATA_STATIC_ID +options ATA_STATIC_ID #options ATA_REQUEST_TIMEOUT=10 options ATA_CAM Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/geom/geom_dev.c Tue Apr 26 17:01:49 2011 (r221071) @@ -113,8 +113,9 @@ g_dev_taste(struct g_class *mp, struct g { struct g_geom *gp; struct g_consumer *cp; - int error; - struct cdev *dev; + int error, len; + struct cdev *dev, *adev; + char buf[64], *val; g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name); g_topology_assert(); @@ -136,12 +137,35 @@ g_dev_taste(struct g_class *mp, struct g g_destroy_geom(gp); return (NULL); } + + /* Search for device alias name and create it if found. */ + adev = NULL; + for (len = MIN(strlen(gp->name), sizeof(buf) - 15); len > 0; len--) { + snprintf(buf, sizeof(buf), "kern.devalias.%s", gp->name); + buf[14 + len] = 0; + val = getenv(buf); + if (val != NULL) { + snprintf(buf, sizeof(buf), "%s%s", + val, gp->name + len); + freeenv(val); + adev = make_dev_alias(dev, buf); + break; + } + } + if (pp->flags & G_PF_CANDELETE) dev->si_flags |= SI_CANDELETE; dev->si_iosize_max = MAXPHYS; gp->softc = dev; dev->si_drv1 = gp; dev->si_drv2 = cp; + if (adev != NULL) { + if (pp->flags & G_PF_CANDELETE) + adev->si_flags |= SI_CANDELETE; + adev->si_iosize_max = MAXPHYS; + adev->si_drv1 = gp; + adev->si_drv2 = cp; + } return (gp); } Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/i386/conf/GENERIC Tue Apr 26 17:01:49 2011 (r221071) @@ -95,6 +95,7 @@ device fdc device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers options ATA_CAM # Handle legacy controllers with CAM +options ATA_STATIC_ID # Static device numbering device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA Modified: head/sys/i386/conf/XBOX ============================================================================== --- head/sys/i386/conf/XBOX Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/i386/conf/XBOX Tue Apr 26 17:01:49 2011 (r221071) @@ -52,6 +52,7 @@ device pci # ATA and ATAPI devices device ata options ATA_CAM +options ATA_STATIC_ID # Static device numbering # ATA/SCSI peripherals device scbus # SCSI bus (required for ATA/SCSI) Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/mips/conf/OCTEON1 Tue Apr 26 17:01:49 2011 (r221071) @@ -99,6 +99,7 @@ device pci device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers options ATA_CAM # Handle legacy controllers with CAM +options ATA_STATIC_ID # Static device numbering device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA Modified: head/sys/mips/conf/std.SWARM ============================================================================== --- head/sys/mips/conf/std.SWARM Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/mips/conf/std.SWARM Tue Apr 26 17:01:49 2011 (r221071) @@ -58,3 +58,4 @@ device pass device ata options ATA_CAM +options ATA_STATIC_ID # Static device numbering Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/modules/cam/Makefile Tue Apr 26 17:01:49 2011 (r221071) @@ -9,6 +9,7 @@ KMOD= cam # See sys/conf/options for the flags that go into the different opt_*.h files. SRCS= opt_cam.h SRCS+= opt_ada.h +SRCS+= opt_ata.h SRCS+= opt_scsi.h SRCS+= opt_cd.h SRCS+= opt_pt.h Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Tue Apr 26 16:56:43 2011 (r221070) +++ head/sys/pc98/conf/GENERIC Tue Apr 26 17:01:49 2011 (r221071) @@ -91,6 +91,7 @@ device fdc device ahci # AHCI-compatible SATA controllers device ata # Legacy ATA/SATA controllers options ATA_CAM # Handle legacy controllers with CAM +options ATA_STATIC_ID # Static device numbering device mvs # Marvell 88SX50XX/88SX60XX/88SX70XX/SoC SATA device siis # SiliconImage SiI3124/SiI3132/SiI3531 SATA From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 18:50:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48231065670; Tue, 26 Apr 2011 18:50:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B31778FC0A; Tue, 26 Apr 2011 18:50:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QIoZQF034213; Tue, 26 Apr 2011 18:50:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QIoZF1034211; Tue, 26 Apr 2011 18:50:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201104261850.p3QIoZF1034211@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 26 Apr 2011 18:50:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221073 - head/sys/dev/usb/controller X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 18:50:35 -0000 Author: hselasky Date: Tue Apr 26 18:50:35 2011 New Revision: 221073 URL: http://svn.freebsd.org/changeset/base/221073 Log: Fix for missing EHCI datatoggle change case. Reported by: Mike Tancsa MFC after: 3 days Approved by: thompsa (mentor) Modified: head/sys/dev/usb/controller/ehci.c Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue Apr 26 18:18:10 2011 (r221072) +++ head/sys/dev/usb/controller/ehci.c Tue Apr 26 18:50:35 2011 (r221073) @@ -1196,6 +1196,8 @@ ehci_data_toggle_update(struct usb_xfer dt ^= 1; /* short packet at the end */ else if (actlen != xlen) dt ^= 1; /* zero length packet at the end */ + else if (xlen == 0) + dt ^= 1; /* zero length transfer */ xfer->endpoint->toggle_next ^= dt; } From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 18:51:19 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1AFB1065672; Tue, 26 Apr 2011 18:51:19 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 992278FC13; Tue, 26 Apr 2011 18:51:19 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 0FBB046B9E; Tue, 26 Apr 2011 14:51:19 -0400 (EDT) Date: Tue, 26 Apr 2011 19:51:18 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Alexander Motin In-Reply-To: <201104261701.p3QH1ngd030888@svn.freebsd.org> Message-ID: References: <201104261701.p3QH1ngd030888@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r221071 - in head: . sys/amd64/conf sys/arm/conf sys/cam sys/cam/ata sys/conf sys/geom sys/i386/conf sys/mips/conf sys/modules/cam sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 18:51:19 -0000 On Tue, 26 Apr 2011, Alexander Motin wrote: > - Add shim to simplify migration to the CAM-based ATA. For each new adaX > device in /dev/ create symbolic link with adY name, trying to mimic old ATA > numbering. Imitation is not complete, but should be enough in most cases to > mount file systems without touching /etc/fstab. > - To know what behavior to mimic, restore ATA_STATIC_ID option in cases > where it was present before. > - Add some more details to UPDATING. Thanks for working on this! I'll give it a spin on some of my test boxes next week and see how it works out. Robert From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 19:11:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C13D91065676; Tue, 26 Apr 2011 19:11:15 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0B368FC18; Tue, 26 Apr 2011 19:11:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QJBFfU034870; Tue, 26 Apr 2011 19:11:15 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QJBFnt034868; Tue, 26 Apr 2011 19:11:15 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201104261911.p3QJBFnt034868@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 26 Apr 2011 19:11:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221074 - head/sbin/hastctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 19:11:15 -0000 Author: trociny Date: Tue Apr 26 19:11:15 2011 New Revision: 221074 URL: http://svn.freebsd.org/changeset/base/221074 Log: Fix assert messages. Approved by: pjd (mentor) Modified: head/sbin/hastctl/hastctl.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Tue Apr 26 18:50:35 2011 (r221073) +++ head/sbin/hastctl/hastctl.c Tue Apr 26 19:11:15 2011 (r221074) @@ -465,7 +465,7 @@ main(int argc, char *argv[]) } break; default: - assert(!"Impossible role!"); + assert(!"Impossible command!"); } /* Setup control connection... */ @@ -512,7 +512,7 @@ main(int argc, char *argv[]) error = control_status(nv); break; default: - assert(!"Impossible role!"); + assert(!"Impossible command!"); } exit(error); From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 19:22:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E24341065670; Tue, 26 Apr 2011 19:22:54 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1FA58FC1B; Tue, 26 Apr 2011 19:22:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QJMsCU035240; Tue, 26 Apr 2011 19:22:54 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QJMs27035238; Tue, 26 Apr 2011 19:22:54 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201104261922.p3QJMs27035238@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 26 Apr 2011 19:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221075 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 19:22:55 -0000 Author: trociny Date: Tue Apr 26 19:22:54 2011 New Revision: 221075 URL: http://svn.freebsd.org/changeset/base/221075 Log: For conversation between hastctl and hastd we should use HASTCTL_CMD defines. Approved by: pjd (mentor) MFC after: 1 week Modified: head/sbin/hastd/control.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Tue Apr 26 19:11:15 2011 (r221074) +++ head/sbin/hastd/control.c Tue Apr 26 19:22:54 2011 (r221075) @@ -324,7 +324,7 @@ control_handle(struct hastd_config *cfg) error = EHAST_INVALID; goto fail; } - if (cmd == HASTCTL_SET_ROLE) { + if (cmd == HASTCTL_CMD_SETROLE) { role = nv_get_uint8(nvin, "role"); switch (role) { case HAST_ROLE_INIT: @@ -345,11 +345,11 @@ control_handle(struct hastd_config *cfg) ii = 0; TAILQ_FOREACH(res, &cfg->hc_resources, hr_next) { switch (cmd) { - case HASTCTL_SET_ROLE: + case HASTCTL_CMD_SETROLE: control_set_role_common(cfg, nvout, role, res, res->hr_name, ii++); break; - case HASTCTL_STATUS: + case HASTCTL_CMD_STATUS: control_status(cfg, nvout, res, res->hr_name, ii++); break; @@ -368,11 +368,11 @@ control_handle(struct hastd_config *cfg) if (str == NULL) break; switch (cmd) { - case HASTCTL_SET_ROLE: + case HASTCTL_CMD_SETROLE: control_set_role_common(cfg, nvout, role, NULL, str, ii); break; - case HASTCTL_STATUS: + case HASTCTL_CMD_STATUS: control_status(cfg, nvout, NULL, str, ii); break; default: From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 19:38:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56C7D106566B; Tue, 26 Apr 2011 19:38:31 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C6B08FC08; Tue, 26 Apr 2011 19:38:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QJcV13035719; Tue, 26 Apr 2011 19:38:31 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QJcV3P035715; Tue, 26 Apr 2011 19:38:31 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201104261938.p3QJcV3P035715@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 26 Apr 2011 19:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221076 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 19:38:31 -0000 Author: trociny Date: Tue Apr 26 19:38:30 2011 New Revision: 221076 URL: http://svn.freebsd.org/changeset/base/221076 Log: Rename HASTCTL_ defines, which are used for conversion between main hastd process and workers, remove unused one and set different range of numbers. This is done in order not to confuse them with HASTCTL_CMD defines, used for conversation between hastctl and hastd, and to avoid bugs like the one fixed in in r221075. Approved by: pjd (mentor) MFC after: 1 week Modified: head/sbin/hastd/control.c head/sbin/hastd/control.h head/sbin/hastd/hastd.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Tue Apr 26 19:22:54 2011 (r221075) +++ head/sbin/hastd/control.c Tue Apr 26 19:38:30 2011 (r221076) @@ -162,7 +162,7 @@ control_status_worker(struct hast_resour * Prepare and send command to worker process. */ cnvout = nv_alloc(); - nv_add_uint8(cnvout, HASTCTL_STATUS, "cmd"); + nv_add_uint8(cnvout, CONTROL_STATUS, "cmd"); error = nv_error(cnvout); if (error != 0) { pjdlog_common(LOG_ERR, 0, error, @@ -427,7 +427,7 @@ ctrl_thread(void *arg) } nvout = nv_alloc(); switch (cmd) { - case HASTCTL_STATUS: + case CONTROL_STATUS: if (res->hr_remotein != NULL && res->hr_remoteout != NULL) { nv_add_string(nvout, "complete", "status"); @@ -448,7 +448,7 @@ ctrl_thread(void *arg) } nv_add_int16(nvout, 0, "error"); break; - case HASTCTL_RELOAD: + case CONTROL_RELOAD: /* * When parent receives SIGHUP and discovers that * something related to us has changes, it sends reload Modified: head/sbin/hastd/control.h ============================================================================== --- head/sbin/hastd/control.h Tue Apr 26 19:22:54 2011 (r221075) +++ head/sbin/hastd/control.h Tue Apr 26 19:38:30 2011 (r221076) @@ -32,9 +32,8 @@ #ifndef _CONTROL_H_ #define _CONTROL_H_ -#define HASTCTL_SET_ROLE 1 -#define HASTCTL_STATUS 2 -#define HASTCTL_RELOAD 3 +#define CONTROL_STATUS 10 +#define CONTROL_RELOAD 11 struct hastd_config; struct hast_resource; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Tue Apr 26 19:22:54 2011 (r221075) +++ head/sbin/hastd/hastd.c Tue Apr 26 19:38:30 2011 (r221076) @@ -424,7 +424,7 @@ resource_reload(const struct hast_resour PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); nvout = nv_alloc(); - nv_add_uint8(nvout, HASTCTL_RELOAD, "cmd"); + nv_add_uint8(nvout, CONTROL_RELOAD, "cmd"); nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr"); nv_add_string(nvout, res->hr_sourceaddr, "sourceaddr"); nv_add_int32(nvout, (int32_t)res->hr_replication, "replication"); From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 19:40:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 175F91065670; Tue, 26 Apr 2011 19:40:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07ADD8FC1A; Tue, 26 Apr 2011 19:40:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QJeb0B035819; Tue, 26 Apr 2011 19:40:37 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QJebFw035817; Tue, 26 Apr 2011 19:40:37 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201104261940.p3QJebFw035817@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 26 Apr 2011 19:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221077 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 19:40:38 -0000 Author: hselasky Date: Tue Apr 26 19:40:37 2011 New Revision: 221077 URL: http://svn.freebsd.org/changeset/base/221077 Log: The maximum NCM frame size must be so that it will generate a short terminated USB transfer if the maximum NCM frame size is greater than what the driver can handle. Reported by: Matthias Benesch MFC after: 7 days Approved by: thompsa (mentor) Modified: head/sys/dev/usb/net/if_cdcereg.h Modified: head/sys/dev/usb/net/if_cdcereg.h ============================================================================== --- head/sys/dev/usb/net/if_cdcereg.h Tue Apr 26 19:38:30 2011 (r221076) +++ head/sys/dev/usb/net/if_cdcereg.h Tue Apr 26 19:40:37 2011 (r221077) @@ -39,7 +39,7 @@ #define CDCE_IND_SIZE_MAX 32 /* bytes */ #define CDCE_NCM_TX_MINLEN 512 /* bytes, must be power of two */ -#define CDCE_NCM_TX_MAXLEN (1UL << 14) /* bytes */ +#define CDCE_NCM_TX_MAXLEN (16384 + 4) /* bytes, must be short terminated */ #define CDCE_NCM_TX_FRAMES_MAX 8 /* units */ #define CDCE_NCM_RX_MAXLEN (1UL << 14) /* bytes */ From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 19:52:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B90C51065679; Tue, 26 Apr 2011 19:52:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9BCE8FC1A; Tue, 26 Apr 2011 19:52:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QJqLgO036201; Tue, 26 Apr 2011 19:52:21 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QJqL7N036199; Tue, 26 Apr 2011 19:52:21 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201104261952.p3QJqL7N036199@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 26 Apr 2011 19:52:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221078 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 19:52:21 -0000 Author: trociny Date: Tue Apr 26 19:52:21 2011 New Revision: 221078 URL: http://svn.freebsd.org/changeset/base/221078 Log: Add missing ifdef. This fixes build with NO_OPENSSL. Reported by: Pawel Tyll Approved by: pjd (mentor) MFC after: 1 week Modified: head/sbin/hastd/hast_proto.c Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Tue Apr 26 19:40:37 2011 (r221077) +++ head/sbin/hastd/hast_proto.c Tue Apr 26 19:52:21 2011 (r221078) @@ -69,7 +69,9 @@ struct hast_pipe_stage { static struct hast_pipe_stage pipeline[] = { { "compression", compression_send, compression_recv }, +#ifdef HAVE_CRYPTO { "checksum", checksum_send, checksum_recv } +#endif }; /* From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 20:14:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 880B11065676; Tue, 26 Apr 2011 20:14:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 794CE8FC16; Tue, 26 Apr 2011 20:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QKETBW036938; Tue, 26 Apr 2011 20:14:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QKETGu036936; Tue, 26 Apr 2011 20:14:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201104262014.p3QKETGu036936@svn.freebsd.org> From: John Baldwin Date: Tue, 26 Apr 2011 20:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221079 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 20:14:29 -0000 Author: jhb Date: Tue Apr 26 20:14:29 2011 New Revision: 221079 URL: http://svn.freebsd.org/changeset/base/221079 Log: Generate the network byte order version of the window size structure in a temporary variable on the stack and then copy that into the output buffer so that the htons() conversions use aligned accesses. MFC after: 1 month Modified: head/usr.bin/rlogin/rlogin.c Modified: head/usr.bin/rlogin/rlogin.c ============================================================================== --- head/usr.bin/rlogin/rlogin.c Tue Apr 26 19:52:21 2011 (r221078) +++ head/usr.bin/rlogin/rlogin.c Tue Apr 26 20:14:29 2011 (r221079) @@ -484,18 +484,18 @@ sigwinch(int signo __unused) void sendwindow(void) { - struct winsize *wp; + struct winsize ws; char obuf[4 + sizeof (struct winsize)]; - wp = (struct winsize *)(obuf+4); obuf[0] = 0377; obuf[1] = 0377; obuf[2] = 's'; obuf[3] = 's'; - wp->ws_row = htons(winsize.ws_row); - wp->ws_col = htons(winsize.ws_col); - wp->ws_xpixel = htons(winsize.ws_xpixel); - wp->ws_ypixel = htons(winsize.ws_ypixel); + ws.ws_row = htons(winsize.ws_row); + ws.ws_col = htons(winsize.ws_col); + ws.ws_xpixel = htons(winsize.ws_xpixel); + ws.ws_ypixel = htons(winsize.ws_ypixel); + bcopy(&ws, obuf + 4, sizeof(ws)); (void)write(rem, obuf, sizeof(obuf)); } From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 20:34:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C930106566C; Tue, 26 Apr 2011 20:34:31 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7A9F8FC16; Tue, 26 Apr 2011 20:34:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QKYUqE037588; Tue, 26 Apr 2011 20:34:30 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QKYUI3037586; Tue, 26 Apr 2011 20:34:30 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201104262034.p3QKYUI3037586@svn.freebsd.org> From: Ryan Stone Date: Tue, 26 Apr 2011 20:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221081 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 20:34:31 -0000 Author: rstone Date: Tue Apr 26 20:34:30 2011 New Revision: 221081 URL: http://svn.freebsd.org/changeset/base/221081 Log: If the 4BSD scheduler tries to schedule a thread that has been pinned or bound to an AP before SMP has started, the system will panic when we try to touch per-CPU state for that AP because that state has not been initialized yet. Fix this in the same way as ULE: place all threads in the global run queue before SMP has started. Reviewed by: jhb MFC after: 1 month Modified: head/sys/kern/sched_4bsd.c Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Tue Apr 26 20:25:16 2011 (r221080) +++ head/sys/kern/sched_4bsd.c Tue Apr 26 20:34:30 2011 (r221081) @@ -1246,25 +1246,27 @@ sched_add(struct thread *td, int flags) } TD_SET_RUNQ(td); - if (td->td_pinned != 0) { - cpu = td->td_lastcpu; - ts->ts_runq = &runq_pcpu[cpu]; - single_cpu = 1; - CTR3(KTR_RUNQ, - "sched_add: Put td_sched:%p(td:%p) on cpu%d runq", ts, td, - cpu); - } else if (td->td_flags & TDF_BOUND) { - /* Find CPU from bound runq. */ - KASSERT(SKE_RUNQ_PCPU(ts), - ("sched_add: bound td_sched not on cpu runq")); - cpu = ts->ts_runq - &runq_pcpu[0]; - single_cpu = 1; - CTR3(KTR_RUNQ, - "sched_add: Put td_sched:%p(td:%p) on cpu%d runq", ts, td, - cpu); - } else if (ts->ts_flags & TSF_AFFINITY) { - /* Find a valid CPU for our cpuset */ - cpu = sched_pickcpu(td); + /* + * If SMP is started and the thread is pinned or otherwise limited to + * a specific set of CPUs, queue the thread to a per-CPU run queue. + * Otherwise, queue the thread to the global run queue. + * + * If SMP has not yet been started we must use the global run queue + * as per-CPU state may not be initialized yet and we may crash if we + * try to access the per-CPU run queues. + */ + if (smp_started && (td->td_pinned != 0 || td->td_flags & TDF_BOUND || + ts->ts_flags & TSF_AFFINITY)) { + if (td->td_pinned != 0) + cpu = td->td_lastcpu; + else if (td->td_flags & TDF_BOUND) { + /* Find CPU from bound runq. */ + KASSERT(SKE_RUNQ_PCPU(ts), + ("sched_add: bound td_sched not on cpu runq")); + cpu = ts->ts_runq - &runq_pcpu[0]; + } else + /* Find a valid CPU for our cpuset */ + cpu = sched_pickcpu(td); ts->ts_runq = &runq_pcpu[cpu]; single_cpu = 1; CTR3(KTR_RUNQ, From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 22:02:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D72AD106564A; Tue, 26 Apr 2011 22:02:51 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE63E8FC15; Tue, 26 Apr 2011 22:02:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QM2pQu040441; Tue, 26 Apr 2011 22:02:51 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QM2p0K040439; Tue, 26 Apr 2011 22:02:51 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201104262202.p3QM2p0K040439@svn.freebsd.org> From: Doug Barton Date: Tue, 26 Apr 2011 22:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221088 - head/usr.bin/rlogin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 22:02:51 -0000 Author: dougb Date: Tue Apr 26 22:02:51 2011 New Revision: 221088 URL: http://svn.freebsd.org/changeset/base/221088 Log: Revert r221053 by replacing WARNS?= 3 since it's breaking the build on several arches. Modified: head/usr.bin/rlogin/Makefile Modified: head/usr.bin/rlogin/Makefile ============================================================================== --- head/usr.bin/rlogin/Makefile Tue Apr 26 21:47:38 2011 (r221087) +++ head/usr.bin/rlogin/Makefile Tue Apr 26 22:02:51 2011 (r221088) @@ -7,4 +7,6 @@ BINOWN= root BINMODE=4555 PRECIOUSPROG= +WARNS?= 3 + .include From owner-svn-src-head@FreeBSD.ORG Tue Apr 26 22:14:11 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CA19106564A; Tue, 26 Apr 2011 22:14:11 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 338198FC18; Tue, 26 Apr 2011 22:14:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QMEB4X040943; Tue, 26 Apr 2011 22:14:11 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QMEBwv040939; Tue, 26 Apr 2011 22:14:11 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201104262214.p3QMEBwv040939@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 26 Apr 2011 22:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221092 - head/contrib/tzdata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2011 22:14:11 -0000 Author: edwin Date: Tue Apr 26 22:14:10 2011 New Revision: 221092 URL: http://svn.freebsd.org/changeset/base/221092 Log: MFV of tzdata2011g, 221089. - Egypt has cancelled the move to DST for now. Modified: head/contrib/tzdata/africa head/contrib/tzdata/europe head/contrib/tzdata/southamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Tue Apr 26 22:13:58 2011 (r221091) +++ head/contrib/tzdata/africa Tue Apr 26 22:14:10 2011 (r221092) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.30
+# @(#)africa	8.31
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -212,7 +212,21 @@ Rule	Egypt	1989	only	-	May	 6	1:00	1:00	
 Rule	Egypt	1990	1994	-	May	 1	1:00	1:00	S
 # IATA (after 1990) says transitions are at 0:00.
 # Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
-Rule	Egypt	1995	max	-	Apr	lastFri	 0:00s	1:00	S
+
+# From Alexander Krivenyshev (2011-04-20):
+# "...Egypt's interim cabinet decided on Wednesday to cancel daylight
+# saving time after a poll posted on its website showed the majority of
+# Egyptians would approve the cancellation."
+#
+# Egypt to cancel daylight saving time
+# 
+# http://www.almasryalyoum.com/en/node/407168
+# 
+# or
+# 
+# http://www.worldtimezone.com/dst_news/dst_news_egypt04.html
+# 
+Rule	Egypt	1995	2010	-	Apr	lastFri	 0:00s	1:00	S
 Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
 # From Steffen Thorsen (2006-09-19):
 # The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
@@ -313,7 +327,7 @@ Rule	Egypt	2008	only	-	Aug	lastThu	23:00
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
 Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
 Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
-Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
+Rule	Egypt	2010	only	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:00 -	LMT	1900 Oct

Modified: head/contrib/tzdata/europe
==============================================================================
--- head/contrib/tzdata/europe	Tue Apr 26 22:13:58 2011	(r221091)
+++ head/contrib/tzdata/europe	Tue Apr 26 22:14:10 2011	(r221092)
@@ -1,5 +1,5 @@
 # 
-# @(#)europe	8.31
+# @(#)europe	8.32
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -146,7 +146,7 @@
 # A monument to Willett was unveiled on 1927-05-21, in an open space in
 # a 45-acre wood near Chislehurst, Kent that was purchased by popular
 # subscription and open to the public.  On the south face of the monolith,
-# designed by G. W. Miller, is the the William Willett Memorial Sundial,
+# designed by G. W. Miller, is the...William Willett Memorial Sundial,
 # which is permanently set to Summer Time.
 
 # From Winston Churchill (1934-04-28):
@@ -1786,7 +1786,7 @@ Zone	Europe/Oslo	0:43:00 -	LMT	1895 Jan 
 #
 # All these events predate our cutoff date of 1970.  Unless we can
 # come up with more definitive info about the timekeeping during the
-# war years it's probably best just do do the following for now:
+# war years it's probably best just do...the following for now:
 Link	Europe/Oslo	Arctic/Longyearbyen
 
 # Poland

Modified: head/contrib/tzdata/southamerica
==============================================================================
--- head/contrib/tzdata/southamerica	Tue Apr 26 22:13:58 2011	(r221091)
+++ head/contrib/tzdata/southamerica	Tue Apr 26 22:14:10 2011	(r221092)
@@ -1,5 +1,5 @@
 # 
-# @(#)southamerica	8.48
+# @(#)southamerica	8.49
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -745,7 +745,7 @@ Zone	America/La_Paz	-4:32:36 -	LMT	1890
 #
 # As a result of the above Decree I believe the America/Rio_Branco
 # timezone shall be modified from UTC-5 to UTC-4 and a new timezone shall
-# be created to represent the the west side of the Para State. I
+# be created to represent the...west side of the Para State. I
 # suggest this new timezone be called Santarem as the most
 # important/populated city in the affected area.
 #

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 26 22:18:44 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BDB47106568C;
	Tue, 26 Apr 2011 22:18:44 +0000 (UTC) (envelope-from andy@fud.org.nz)
Received: from mail-ww0-f42.google.com (mail-ww0-f42.google.com [74.125.82.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 1461F8FC14;
	Tue, 26 Apr 2011 22:18:43 +0000 (UTC)
Received: by wwk4 with SMTP id 4so2740120wwk.1
	for ; Tue, 26 Apr 2011 15:18:42 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.253.138 with SMTP id f10mr245408wes.30.1303856321479; Tue,
	26 Apr 2011 15:18:41 -0700 (PDT)
Sender: andy@fud.org.nz
Received: by 10.216.181.144 with HTTP; Tue, 26 Apr 2011 15:18:41 -0700 (PDT)
In-Reply-To: <201104262202.p3QM2p0K040439@svn.freebsd.org>
References: <201104262202.p3QM2p0K040439@svn.freebsd.org>
Date: Wed, 27 Apr 2011 10:18:41 +1200
X-Google-Sender-Auth: ue2Fwup4c2rpKZKAgxA7y1OQlvM
Message-ID: 
From: Andrew Thompson 
To: Doug Barton 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221088 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 26 Apr 2011 22:18:44 -0000

On 27 April 2011 10:02, Doug Barton  wrote:
> Author: dougb
> Date: Tue Apr 26 22:02:51 2011
> New Revision: 221088
> URL: http://svn.freebsd.org/changeset/base/221088
>
> Log:
> =A0Revert r221053 by replacing WARNS?=3D 3 since it's breaking the build =
on
> =A0several arches.

r221079 from jhb may have already fixed it.

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 26 22:18:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 297C1106564A;
	Tue, 26 Apr 2011 22:18:54 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1A51E8FC12;
	Tue, 26 Apr 2011 22:18:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3QMIro3041283;
	Tue, 26 Apr 2011 22:18:53 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3QMIr13041281;
	Tue, 26 Apr 2011 22:18:53 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201104262218.p3QMIr13041281@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Tue, 26 Apr 2011 22:18:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221096 - head/sys/vm
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 26 Apr 2011 22:18:54 -0000

Author: obrien
Date: Tue Apr 26 22:18:53 2011
New Revision: 221096
URL: http://svn.freebsd.org/changeset/base/221096

Log:
  Reap old SPL comments.
  
  Reviewed by:	alc

Modified:
  head/sys/vm/swap_pager.c

Modified: head/sys/vm/swap_pager.c
==============================================================================
--- head/sys/vm/swap_pager.c	Tue Apr 26 22:17:10 2011	(r221095)
+++ head/sys/vm/swap_pager.c	Tue Apr 26 22:18:53 2011	(r221096)
@@ -424,7 +424,6 @@ swp_pager_free_nrpage(vm_page_t m)
  *
  *	No restrictions on call
  *	This routine may not block.
- *	This routine must be called at splvm()
  */
 static void
 swp_sizecheck(void)
@@ -449,8 +448,6 @@ swp_sizecheck(void)
  *	the object and page index.  It returns a pointer to a pointer
  *	to the object, or a pointer to a NULL pointer if it could not
  *	find a swapblk.
- *
- *	This routine must be called at splvm().
  */
 static struct swblock **
 swp_pager_hash(vm_object_t object, vm_pindex_t index)
@@ -590,12 +587,7 @@ swap_pager_swap_init(void)
  *	and then converting it with swp_pager_meta_build().
  *
  *	This routine may block in vm_object_allocate() and create a named
- *	object lookup race, so we must interlock.   We must also run at
- *	splvm() for the object lookup to handle races with interrupts, but
- *	we do not have to maintain splvm() in between the lookup and the
- *	add because (I believe) it is not possible to attempt to create
- *	a new swap object w/handle when a default object with that handle
- *	already exists.
+ *	object lookup race, so we must interlock.
  *
  * MPSAFE
  */
@@ -708,11 +700,7 @@ swap_pager_dealloc(vm_object_t object)
  *	Also has the side effect of advising that somebody made a mistake
  *	when they configured swap and didn't configure enough.
  *
- *	Must be called at splvm() to avoid races with bitmap frees from
- *	vm_page_remove() aka swap_pager_page_removed().
- *
  *	This routine may not block
- *	This routine must be called at splvm().
  *
  *	We allocate in round-robin fashion from the configured devices.
  */
@@ -785,11 +773,7 @@ swp_pager_strategy(struct buf *bp)
  *	Note:  This routine may not block (it could in the old swap code),
  *	and through the use of the new blist routines it does not block.
  *
- *	We must be called at splvm() to avoid races with bitmap frees from
- *	vm_page_remove() aka swap_pager_page_removed().
- *
  *	This routine may not block
- *	This routine must be called at splvm().
  */
 static void
 swp_pager_freeswapspace(daddr_t blk, int npages)
@@ -829,9 +813,6 @@ swp_pager_freeswapspace(daddr_t blk, int
  *	The external callers of this routine typically have already destroyed 
  *	or renamed vm_page_t's associated with this range in the object so 
  *	we should be ok.
- *
- *	This routine may be called at any spl.  We up our spl to splvm temporarily
- *	in order to perform the metadata removal.
  */
 void
 swap_pager_freespace(vm_object_t object, vm_pindex_t start, vm_size_t size)
@@ -892,8 +873,6 @@ swap_pager_reserve(vm_object_t object, v
  *	indirectly through swp_pager_meta_build() or if paging is still in
  *	progress on the source. 
  *
- *	This routine can be called at any spl
- *
  *	XXX vm_page_collapse() kinda expects us not to block because we 
  *	supposedly do not need to allocate memory, but for the moment we
  *	*may* have to get a little memory from the zone allocator, but
@@ -1082,7 +1061,6 @@ swap_pager_haspage(vm_object_t object, v
  *	depends on it.
  *
  *	This routine may not block
- *	This routine must be called at splvm()
  */
 static void
 swap_pager_unswapped(vm_page_t m)
@@ -1813,9 +1791,7 @@ restart:
  ************************************************************************
  *
  *	These routines manipulate the swap metadata stored in the 
- *	OBJT_SWAP object.  All swp_*() routines must be called at
- *	splvm() because swap can be freed up by the low level vm_page
- *	code which might be called from interrupts beyond what splbio() covers.
+ *	OBJT_SWAP object.
  *
  *	Swap metadata is implemented with a global hash and not directly
  *	linked into the object.  Instead the object simply contains
@@ -1831,9 +1807,6 @@ restart:
  *	The specified swapblk is added to the object's swap metadata.  If
  *	the swapblk is not valid, it is freed instead.  Any previously
  *	assigned swapblk is freed.
- *
- *	This routine must be called at splvm(), except when used to convert
- *	an OBJT_DEFAULT object into an OBJT_SWAP object.
  */
 static void
 swp_pager_meta_build(vm_object_t object, vm_pindex_t pindex, daddr_t swapblk)
@@ -1930,8 +1903,6 @@ done:
  *	This routine will free swap metadata structures as they are cleaned 
  *	out.  This routine does *NOT* operate on swap metadata associated
  *	with resident pages.
- *
- *	This routine must be called at splvm()
  */
 static void
 swp_pager_meta_free(vm_object_t object, vm_pindex_t index, daddr_t count)
@@ -1977,8 +1948,6 @@ swp_pager_meta_free(vm_object_t object, 
  *
  *	This routine locates and destroys all swap metadata associated with
  *	an object.
- *
- *	This routine must be called at splvm()
  */
 static void
 swp_pager_meta_free_all(vm_object_t object)
@@ -2033,8 +2002,6 @@ swp_pager_meta_free_all(vm_object_t obje
  *	have to wait until paging is complete but otherwise can act on the 
  *	busy page.
  *
- *	This routine must be called at splvm().
- *
  *	SWM_FREE	remove and free swap block from metadata
  *	SWM_POP		remove from meta data but do not free.. pop it out
  */

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 26 22:26:42 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB339106566B;
	Tue, 26 Apr 2011 22:26:42 +0000 (UTC) (envelope-from obrien@NUXI.org)
Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85])
	by mx1.freebsd.org (Postfix) with ESMTP id CC0B28FC20;
	Tue, 26 Apr 2011 22:26:42 +0000 (UTC)
Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1])
	by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id p3QMQgrJ044455;
	Tue, 26 Apr 2011 15:26:42 -0700 (PDT)
	(envelope-from obrien@dragon.nuxi.org)
Received: (from obrien@localhost)
	by dragon.nuxi.org (8.14.4/8.14.4/Submit) id p3QMQfEt044454;
	Tue, 26 Apr 2011 15:26:41 -0700 (PDT) (envelope-from obrien)
Date: Tue, 26 Apr 2011 15:26:41 -0700
From: "David O'Brien" 
To: John Baldwin 
Message-ID: <20110426222641.GA44259@dragon.NUXI.org>
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104260932.44199.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201104260932.44199.jhb@freebsd.org>
X-Operating-System: FreeBSD 9.0-CURRENT
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN?
User-Agent: Mutt/1.5.16 (2007-06-09)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: obrien@freebsd.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 26 Apr 2011 22:26:43 -0000

On Tue, Apr 26, 2011 at 09:32:44AM -0400, John Baldwin wrote:
> On Tuesday, April 26, 2011 12:09:20 am David E. O'Brien wrote:
> > Author: obrien
> > Date: Tue Apr 26 04:09:20 2011
> > New Revision: 221053
> > URL: http://svn.freebsd.org/changeset/base/221053
> > 
> > Log:
> >   This builds OK using the parent dir's WARNS=6.
> >   [built on both AMD64 and i386]
> 
> This breaks the tinderbox on at least arm, ia64, mips, and sparc64.

Sigh.  Do we yet have ARM, MIPS, or Sparc64 test machines in
the cluster?  http://www.freebsd.org/internal/machines.html doesn't list
any, but maybe some have been added?

-- 
-- David  (obrien@FreeBSD.org)

From owner-svn-src-head@FreeBSD.ORG  Tue Apr 26 23:31:45 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35])
	by hub.freebsd.org (Postfix) with ESMTP id 8904A106566C;
	Tue, 26 Apr 2011 23:31:45 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from 65-241-43-5.globalsuite.net (hub.freebsd.org
	[IPv6:2001:4f8:fff6::36])
	by mx2.freebsd.org (Postfix) with ESMTP id 4E033154969;
	Tue, 26 Apr 2011 23:31:45 +0000 (UTC)
Message-ID: <4DB755E0.6020104@FreeBSD.org>
Date: Tue, 26 Apr 2011 16:31:44 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110319 Thunderbird/3.1.9
MIME-Version: 1.0
To: Andrew Thompson 
References: <201104262202.p3QM2p0K040439@svn.freebsd.org>
	
In-Reply-To: 
X-Enigmail-Version: 1.1.2
OpenPGP: id=1A1ABC84
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221088 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 26 Apr 2011 23:31:45 -0000

On 04/26/2011 15:18, Andrew Thompson wrote:
> On 27 April 2011 10:02, Doug Barton  wrote:
>> Author: dougb
>> Date: Tue Apr 26 22:02:51 2011
>> New Revision: 221088
>> URL: http://svn.freebsd.org/changeset/base/221088
>>
>> Log:
>>   Revert r221053 by replacing WARNS?= 3 since it's breaking the build on
>>   several arches.
>
> r221079 from jhb may have already fixed it.

Great, I'll let someone who cares do the testing to determine that. Once 
it's tested I have no objections to someone reverting my reversion. :)


Doug

-- 

	Nothin' ever doesn't change, but nothin' changes much.
			-- OK Go

	Breadth of IT experience, and depth of knowledge in the DNS.
	Yours for the right price.  :)  http://SupersetSolutions.com/


From owner-svn-src-head@FreeBSD.ORG  Tue Apr 26 23:49:00 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 02E8B106566B;
	Tue, 26 Apr 2011 23:49:00 +0000 (UTC)
	(envelope-from doconnor@gsoft.com.au)
Received: from cain.gsoft.com.au (unknown
	[IPv6:2001:44b8:7c07:5581:266:e1ff:fe0c:8f16])
	by mx1.freebsd.org (Postfix) with ESMTP id 5E3FC8FC16;
	Tue, 26 Apr 2011 23:48:57 +0000 (UTC)
Received: from [10.4.33.117] ([202.90.207.206]) (authenticated bits=0)
	by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id p3QNmdMq084169
	(version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO);
	Wed, 27 Apr 2011 09:18:40 +0930 (CST)
	(envelope-from doconnor@gsoft.com.au)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: "Daniel O'Connor" 
In-Reply-To: 
Date: Wed, 27 Apr 2011 09:48:39 +1000
Content-Transfer-Encoding: quoted-printable
Message-Id: <15C958E3-6CF7-48C4-88C9-2E61AC301657@gsoft.com.au>
References: <201104240923.p3O9N8QG025386@svn.freebsd.org>
	<20110424161933.GA18775@vniz.net>
	<18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au>
	
	<34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au>
	
To: Warner Losh 
X-Mailer: Apple Mail (2.1084)
X-Spam-Score: -0.272 () BAYES_00,RDNS_NONE
X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10
Cc: svn-src-head@FreeBSD.org, Alexander Motin ,
	src-committers@FreeBSD.org, Andrey Chernov ,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r220983 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Tue, 26 Apr 2011 23:49:00 -0000


On 26/04/2011, at 1:31, Warner Losh wrote:
>> This is why I prefer IDs since they are nominally unique (UFS ones, =
GPTs damn well better be :)
>>=20
>> Although I concede it is rather annoying to work out which is which, =
or type them out manually..
>=20
> For things like ZFS, UUIDs aren't so bad because it hides them.

Yes, I use GPT with ZFS, it's good :)

> For things like /etc/fstab, I prefer the named approach.  This allows =
me to survive a newfs on a partition if I have to without having to hack =
my /etc/fstab.  I have a large /tmp partition at times, and it gets =
newfs'd if there's a bad problem...

Yeah, but..
IMHO if the installer supports it then it is dramatically less painful..

I haven't looked to see how hard it is to add, hopefully I will get some =
time to look RSN and it shouldn't be too difficult.

FWIW the above shell snippet is found in a post [sys]install shell =
script I used for 6.x and later so it has had a bit of testing.

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C







From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 00:10:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DFA70106566B;
	Wed, 27 Apr 2011 00:10:26 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CD82B8FC1B;
	Wed, 27 Apr 2011 00:10:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R0AQid044876;
	Wed, 27 Apr 2011 00:10:26 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R0AQQv044866;
	Wed, 27 Apr 2011 00:10:26 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201104270010.p3R0AQQv044866@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 27 Apr 2011 00:10:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221101 - in head/sys/geom: . concat journal mirror
	raid3 shsec stripe virstor
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 00:10:27 -0000

Author: mav
Date: Wed Apr 27 00:10:26 2011
New Revision: 221101
URL: http://svn.freebsd.org/changeset/base/221101

Log:
  Implement relaxed comparision for hardcoded provider names to make it
  ignore adX/adaY difference in both directions to simplify migration to
  the CAM-based ATA or back.

Modified:
  head/sys/geom/concat/g_concat.c
  head/sys/geom/geom.h
  head/sys/geom/geom_subr.c
  head/sys/geom/journal/g_journal.c
  head/sys/geom/mirror/g_mirror.c
  head/sys/geom/raid3/g_raid3.c
  head/sys/geom/shsec/g_shsec.c
  head/sys/geom/stripe/g_stripe.c
  head/sys/geom/virstor/g_virstor.c

Modified: head/sys/geom/concat/g_concat.c
==============================================================================
--- head/sys/geom/concat/g_concat.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/concat/g_concat.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -678,7 +678,8 @@ g_concat_taste(struct g_class *mp, struc
 	if (md.md_version < 4)
 		md.md_provsize = pp->mediasize;
 
-	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+	if (md.md_provider[0] != '\0' &&
+	    !g_compare_names(md.md_provider, pp->name))
 		return (NULL);
 	if (md.md_provsize != pp->mediasize)
 		return (NULL);

Modified: head/sys/geom/geom.h
==============================================================================
--- head/sys/geom/geom.h	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/geom.h	Wed Apr 27 00:10:26 2011	(r221101)
@@ -238,6 +238,7 @@ void g_waitidlelock(void);
 /* geom_subr.c */
 int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl);
 int g_attach(struct g_consumer *cp, struct g_provider *pp);
+int g_compare_names(const char *namea, const char *nameb);
 void g_destroy_consumer(struct g_consumer *cp);
 void g_destroy_geom(struct g_geom *pp);
 void g_destroy_provider(struct g_provider *pp);

Modified: head/sys/geom/geom_subr.c
==============================================================================
--- head/sys/geom/geom_subr.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/geom_subr.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -1017,6 +1017,43 @@ g_getattr__(const char *attr, struct g_c
 	return (0);
 }
 
+static int
+g_get_device_prefix_len(const char *name)
+{
+	int len;
+
+	if (strncmp(name, "ada", 3) == 0)
+		len = 3;
+	else if (strncmp(name, "ad", 2) == 0)
+		len = 2;
+	else
+		return (0);
+	if (name[len] < '0' || name[len] > '9')
+		return (0);
+	do {
+		len++;
+	} while (name[len] >= '0' && name[len] <= '9');
+	return (len);
+}
+
+int
+g_compare_names(const char *namea, const char *nameb)
+{
+	int deva, devb;
+
+	if (strcmp(namea, nameb) == 0)
+		return (1);
+	deva = g_get_device_prefix_len(namea);
+	if (deva == 0)
+		return (0);
+	devb = g_get_device_prefix_len(nameb);
+	if (devb == 0)
+		return (0);
+	if (strcmp(namea + deva, nameb + devb) == 0)
+		return (1);
+	return (0);
+}
+
 #if defined(DIAGNOSTIC) || defined(DDB)
 /*
  * This function walks the mesh and returns a non-zero integer if it

Modified: head/sys/geom/journal/g_journal.c
==============================================================================
--- head/sys/geom/journal/g_journal.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/journal/g_journal.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -2527,7 +2527,8 @@ g_journal_taste(struct g_class *mp, stru
 		return (NULL);
 	gp = NULL;
 
-	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+	if (md.md_provider[0] != '\0' &&
+	    !g_compare_names(md.md_provider, pp->name))
 		return (NULL);
 	if (md.md_provsize != 0 && md.md_provsize != pp->mediasize)
 		return (NULL);

Modified: head/sys/geom/mirror/g_mirror.c
==============================================================================
--- head/sys/geom/mirror/g_mirror.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/mirror/g_mirror.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -3007,7 +3007,8 @@ g_mirror_taste(struct g_class *mp, struc
 		return (NULL);
 	gp = NULL;
 
-	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+	if (md.md_provider[0] != '\0' &&
+	    !g_compare_names(md.md_provider, pp->name))
 		return (NULL);
 	if (md.md_provsize != 0 && md.md_provsize != pp->mediasize)
 		return (NULL);

Modified: head/sys/geom/raid3/g_raid3.c
==============================================================================
--- head/sys/geom/raid3/g_raid3.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/raid3/g_raid3.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -3329,7 +3329,8 @@ g_raid3_taste(struct g_class *mp, struct
 		return (NULL);
 	gp = NULL;
 
-	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+	if (md.md_provider[0] != '\0' &&
+	    !g_compare_names(md.md_provider, pp->name))
 		return (NULL);
 	if (md.md_provsize != 0 && md.md_provsize != pp->mediasize)
 		return (NULL);

Modified: head/sys/geom/shsec/g_shsec.c
==============================================================================
--- head/sys/geom/shsec/g_shsec.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/shsec/g_shsec.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -673,7 +673,8 @@ g_shsec_taste(struct g_class *mp, struct
 	if (md.md_version < 1)
 		md.md_provsize = pp->mediasize;
 
-	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+	if (md.md_provider[0] != '\0' &&
+	    !g_compare_names(md.md_provider, pp->name))
 		return (NULL);
 	if (md.md_provsize != pp->mediasize)
 		return (NULL);

Modified: head/sys/geom/stripe/g_stripe.c
==============================================================================
--- head/sys/geom/stripe/g_stripe.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/stripe/g_stripe.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -952,7 +952,8 @@ g_stripe_taste(struct g_class *mp, struc
 	if (md.md_version < 3)
 		md.md_provsize = pp->mediasize;
 
-	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
+	if (md.md_provider[0] != '\0' &&
+	    !g_compare_names(md.md_provider, pp->name))
 		return (NULL);
 	if (md.md_provsize != pp->mediasize)
 		return (NULL);

Modified: head/sys/geom/virstor/g_virstor.c
==============================================================================
--- head/sys/geom/virstor/g_virstor.c	Tue Apr 26 23:00:32 2011	(r221100)
+++ head/sys/geom/virstor/g_virstor.c	Wed Apr 27 00:10:26 2011	(r221101)
@@ -809,10 +809,9 @@ g_virstor_taste(struct g_class *mp, stru
 	/* If the provider name is hardcoded, use the offered provider only
 	 * if it's been offered with its proper name (the one used in
 	 * the label command). */
-	if (md.provider[0] != '\0') {
-		if (strcmp(md.provider, pp->name) != 0)
-			return (NULL);
-	}
+	if (md.provider[0] != '\0' &&
+	    !g_compare_names(md.provider, pp->name))
+		return (NULL);
 
 	/* Iterate all geoms this class already knows about to see if a new
 	 * geom instance of this class needs to be created (in case the provider

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 00:32:35 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D8BBA106564A;
	Wed, 27 Apr 2011 00:32:35 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7E938FC16;
	Wed, 27 Apr 2011 00:32:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R0WZdd045606;
	Wed, 27 Apr 2011 00:32:35 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R0WZEF045604;
	Wed, 27 Apr 2011 00:32:35 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201104270032.p3R0WZEF045604@svn.freebsd.org>
From: Jung-uk Kim 
Date: Wed, 27 Apr 2011 00:32:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221102 - head/sys/x86/cpufreq
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 00:32:35 -0000

Author: jkim
Date: Wed Apr 27 00:32:35 2011
New Revision: 221102
URL: http://svn.freebsd.org/changeset/base/221102

Log:
  Use ACPI-supplied CPU frequencies instead of estimated ones as we are about
  to use other values from the same table anyway.
  
  MFC after:	3 days

Modified:
  head/sys/x86/cpufreq/powernow.c

Modified: head/sys/x86/cpufreq/powernow.c
==============================================================================
--- head/sys/x86/cpufreq/powernow.c	Wed Apr 27 00:10:26 2011	(r221101)
+++ head/sys/x86/cpufreq/powernow.c	Wed Apr 27 00:32:35 2011	(r221102)
@@ -801,15 +801,13 @@ pn_decode_acpi(device_t dev, device_t pe
 			if ((sc->errata & A0_ERRATA) &&
 			    (pn7_fid_to_mult[state.fid] % 10) == 5)
 				continue;
-			state.freq = 100 * pn7_fid_to_mult[state.fid] * sc->fsb;
 			break;
 		case PN8_TYPE:
 			state.fid = ACPI_PN8_CTRL_TO_FID(ctrl);
 			state.vid = ACPI_PN8_CTRL_TO_VID(ctrl);
-			state.freq = 100 * pn8_fid_to_mult[state.fid] * sc->fsb;
 			break;
 		}
-
+		state.freq = sets[i].freq * 1000;
 		state.power = sets[i].power;
 
 		j = n;
@@ -841,6 +839,7 @@ pn_decode_acpi(device_t dev, device_t pe
 			device_printf(dev, "ACPI MAX frequency not found\n");
 			return (EINVAL);
 		}
+		sc->fsb = state.freq / 100 / pn7_fid_to_mult[state.fid];
 		break;
 	case PN8_TYPE:
 		sc->vst = ACPI_PN8_CTRL_TO_VST(ctrl),
@@ -856,6 +855,7 @@ pn_decode_acpi(device_t dev, device_t pe
 		if (sc->powernow_max_states >= 2 &&
 		    (sc->powernow_states[sc->powernow_max_states - 2].fid < 8))
 			return (EINVAL);
+		sc->fsb = state.freq / 100 / pn8_fid_to_mult[state.fid];
 		break;
 	}
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 01:10:15 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E4836106564A;
	Wed, 27 Apr 2011 01:10:15 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D32178FC0C;
	Wed, 27 Apr 2011 01:10:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R1AF23046803;
	Wed, 27 Apr 2011 01:10:15 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R1AFMG046800;
	Wed, 27 Apr 2011 01:10:15 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104270110.p3R1AFMG046800@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Apr 2011 01:10:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221103 - head/share/man/man9
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 01:10:16 -0000

Author: des
Date: Wed Apr 27 01:10:15 2011
New Revision: 221103
URL: http://svn.freebsd.org/changeset/base/221103

Log:
  Rename alloc_unr(9) to unr(9) and adjust the links accordingly.
  
  MFC after:	3 weeks

Added:
  head/share/man/man9/unr.9
     - copied, changed from r210235, head/share/man/man9/alloc_unr.9
Deleted:
  head/share/man/man9/alloc_unr.9
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Wed Apr 27 00:32:35 2011	(r221102)
+++ head/share/man/man9/Makefile	Wed Apr 27 01:10:15 2011	(r221103)
@@ -5,7 +5,6 @@ MAN=	accept_filter.9 \
 	accf_dns.9 \
 	accf_http.9 \
 	acl.9 \
-	alloc_unr.9 \
 	alq.9 \
 	altq.9 \
 	atomic.9 \
@@ -257,6 +256,7 @@ MAN=	accept_filter.9 \
 	ucred.9 \
 	uidinfo.9 \
 	uio.9 \
+	unr.9 \
 	usbdi.9 \
 	utopia.9 \
 	vaccess.9 \
@@ -377,11 +377,12 @@ MAN=	accept_filter.9 \
 	zero_copy.9 \
 	zone.9
 
-MLINKS=	alloc_unr.9 alloc_unrl.9 \
-	alloc_unr.9 alloc_unr_specific.9 \
-	alloc_unr.9 delete_unrhdr.9 \
-	alloc_unr.9 free_unr.9 \
-	alloc_unr.9 new_unrhdr.9
+MLINKS=	unr.9 alloc_unr.9 \
+	unr.9 alloc_unrl.9 \
+	unr.9 alloc_unr_specific.9 \
+	unr.9 delete_unrhdr.9 \
+	unr.9 free_unr.9 \
+	unr.9 new_unrhdr.9
 MLINKS+=alq.9 ALQ.9 \
 	alq.9 alq_close.9 \
 	alq.9 alq_flush.9 \

Copied and modified: head/share/man/man9/unr.9 (from r210235, head/share/man/man9/alloc_unr.9)
==============================================================================
--- head/share/man/man9/alloc_unr.9	Mon Jul 19 12:52:19 2010	(r210235, copy source)
+++ head/share/man/man9/unr.9	Wed Apr 27 01:10:15 2011	(r221103)
@@ -25,7 +25,7 @@
 .\" $FreeBSD$
 .\"
 .Dd July 5, 2010
-.Dt ALLOC_UNR 9
+.Dt UNR 9
 .Os
 .Sh NAME
 .Nm new_unrhdr ,

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 02:32:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B644D106566C;
	Wed, 27 Apr 2011 02:32:41 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A488E8FC08;
	Wed, 27 Apr 2011 02:32:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R2Wfvo049709;
	Wed, 27 Apr 2011 02:32:41 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R2Wfof049707;
	Wed, 27 Apr 2011 02:32:41 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104270232.p3R2Wfof049707@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Apr 2011 02:32:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221107 - head/sbin/fsck_ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 02:32:41 -0000

Author: des
Date: Wed Apr 27 02:32:41 2011
New Revision: 221107
URL: http://svn.freebsd.org/changeset/base/221107

Log:
  Alphabetize the options.  No date bump since no actual change to the text.
  
  MFC after:	3 weeks

Modified:
  head/sbin/fsck_ffs/fsck_ffs.8

Modified: head/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- head/sbin/fsck_ffs/fsck_ffs.8	Wed Apr 27 02:12:01 2011	(r221106)
+++ head/sbin/fsck_ffs/fsck_ffs.8	Wed Apr 27 02:32:41 2011	(r221107)
@@ -139,6 +139,10 @@ action.
 The following flags are interpreted by
 .Nm :
 .Bl -tag -width indent
+.It Fl B
+A check is done on the specified and possibly active file system.
+The set of corrections that can be done is limited to those done
+when running in preen mode (see the
 .It Fl F
 Determine whether the file system needs to be cleaned immediately
 in foreground, or if its cleaning can be deferred to background.
@@ -160,10 +164,6 @@ The only thing that
 .Nm
 does is to determine whether a foreground or background
 check is needed and exit with an appropriate status code.
-.It Fl B
-A check is done on the specified and possibly active file system.
-The set of corrections that can be done is limited to those done
-when running in preen mode (see the
 .Fl p
 flag).
 If unexpected errors are found,

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 02:35:57 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 83918106567A;
	Wed, 27 Apr 2011 02:35:57 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 720EB8FC19;
	Wed, 27 Apr 2011 02:35:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R2ZvLL049858;
	Wed, 27 Apr 2011 02:35:57 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R2Zvev049856;
	Wed, 27 Apr 2011 02:35:57 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104270235.p3R2Zvev049856@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Apr 2011 02:35:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221108 - head/sbin/fsck_ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 02:35:57 -0000

Author: des
Date: Wed Apr 27 02:35:57 2011
New Revision: 221108
URL: http://svn.freebsd.org/changeset/base/221108

Log:
  Fix boo-boo in previous commit.
  
  MFC after:	3 weeks

Modified:
  head/sbin/fsck_ffs/fsck_ffs.8

Modified: head/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- head/sbin/fsck_ffs/fsck_ffs.8	Wed Apr 27 02:32:41 2011	(r221107)
+++ head/sbin/fsck_ffs/fsck_ffs.8	Wed Apr 27 02:35:57 2011	(r221108)
@@ -38,7 +38,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl BFprfny
+.Op Fl BFfnpry
 .Op Fl b Ar block
 .Op Fl c Ar level
 .Op Fl m Ar mode
@@ -143,6 +143,12 @@ The following flags are interpreted by
 A check is done on the specified and possibly active file system.
 The set of corrections that can be done is limited to those done
 when running in preen mode (see the
+.Fl p
+flag).
+If unexpected errors are found,
+the file system is marked as needing a foreground check and
+.Nm
+exits without attempting any further cleaning.
 .It Fl F
 Determine whether the file system needs to be cleaned immediately
 in foreground, or if its cleaning can be deferred to background.
@@ -164,12 +170,6 @@ The only thing that
 .Nm
 does is to determine whether a foreground or background
 check is needed and exit with an appropriate status code.
-.Fl p
-flag).
-If unexpected errors are found,
-the file system is marked as needing a foreground check and
-.Nm
-exits without attempting any further cleaning.
 .It Fl b
 Use the block specified immediately after the flag as
 the super block for the file system.

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 02:55:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82AD0106564A;
	Wed, 27 Apr 2011 02:55:03 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6977A8FC16;
	Wed, 27 Apr 2011 02:55:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R2t3tE050520;
	Wed, 27 Apr 2011 02:55:03 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R2t3Pt050514;
	Wed, 27 Apr 2011 02:55:03 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104270255.p3R2t3Pt050514@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Apr 2011 02:55:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221110 - head/sbin/fsck_ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 02:55:03 -0000

Author: des
Date: Wed Apr 27 02:55:03 2011
New Revision: 221110
URL: http://svn.freebsd.org/changeset/base/221110

Log:
  Mechanical whitespace cleanup.
  
  MFC after:	3 weeks

Modified:
  head/sbin/fsck_ffs/ea.c
  head/sbin/fsck_ffs/inode.c
  head/sbin/fsck_ffs/main.c
  head/sbin/fsck_ffs/pass2.c
  head/sbin/fsck_ffs/suj.c
  head/sbin/fsck_ffs/utilities.c

Modified: head/sbin/fsck_ffs/ea.c
==============================================================================
--- head/sbin/fsck_ffs/ea.c	Wed Apr 27 02:41:26 2011	(r221109)
+++ head/sbin/fsck_ffs/ea.c	Wed Apr 27 02:55:03 2011	(r221110)
@@ -83,4 +83,3 @@ eascan(struct inodesc *idesc, struct ufs
 	return (STOP);
 #endif
 }
-

Modified: head/sbin/fsck_ffs/inode.c
==============================================================================
--- head/sbin/fsck_ffs/inode.c	Wed Apr 27 02:41:26 2011	(r221109)
+++ head/sbin/fsck_ffs/inode.c	Wed Apr 27 02:55:03 2011	(r221110)
@@ -91,18 +91,18 @@ ckinode(union dinode *dp, struct inodesc
 				/* An empty block in a directory XXX */
 				getpathname(pathbuf, idesc->id_number,
 						idesc->id_number);
-                        	pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
+				pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
 					pathbuf);
-                        	if (reply("ADJUST LENGTH") == 1) {
+				if (reply("ADJUST LENGTH") == 1) {
 					dp = ginode(idesc->id_number);
-                                	DIP_SET(dp, di_size,
+					DIP_SET(dp, di_size,
 					    i * sblock.fs_bsize);
 					printf(
 					    "YOU MUST RERUN FSCK AFTERWARDS\n");
 					rerun = 1;
-                                	inodirty();
-					
-                        	}
+					inodirty();
+
+				}
 			}
 			continue;
 		}
@@ -130,19 +130,19 @@ ckinode(union dinode *dp, struct inodesc
 				/* An empty block in a directory XXX */
 				getpathname(pathbuf, idesc->id_number,
 						idesc->id_number);
-                        	pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
+				pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
 					pathbuf);
-                        	if (reply("ADJUST LENGTH") == 1) {
+				if (reply("ADJUST LENGTH") == 1) {
 					dp = ginode(idesc->id_number);
-                                	DIP_SET(dp, di_size,
+					DIP_SET(dp, di_size,
 					    DIP(dp, di_size) - remsize);
 					remsize = 0;
 					printf(
 					    "YOU MUST RERUN FSCK AFTERWARDS\n");
 					rerun = 1;
-                                	inodirty();
+					inodirty();
 					break;
-                        	}
+				}
 			}
 		}
 		remsize -= sizepb;
@@ -209,20 +209,20 @@ iblock(struct inodesc *idesc, long ileve
 				/* An empty block in a directory XXX */
 				getpathname(pathbuf, idesc->id_number,
 						idesc->id_number);
-                        	pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
+				pfatal("DIRECTORY %s: CONTAINS EMPTY BLOCKS",
 					pathbuf);
-                        	if (reply("ADJUST LENGTH") == 1) {
+				if (reply("ADJUST LENGTH") == 1) {
 					dp = ginode(idesc->id_number);
-                                	DIP_SET(dp, di_size,
+					DIP_SET(dp, di_size,
 					    DIP(dp, di_size) - isize);
 					isize = 0;
 					printf(
 					    "YOU MUST RERUN FSCK AFTERWARDS\n");
 					rerun = 1;
-                                	inodirty();
+					inodirty();
 					bp->b_flags &= ~B_INUSE;
 					return(STOP);
-                        	}
+				}
 			}
 		}
 		isize -= sizepb;

Modified: head/sbin/fsck_ffs/main.c
==============================================================================
--- head/sbin/fsck_ffs/main.c	Wed Apr 27 02:41:26 2011	(r221109)
+++ head/sbin/fsck_ffs/main.c	Wed Apr 27 02:55:03 2011	(r221110)
@@ -407,7 +407,7 @@ checkfilesys(char *filesys)
 		sblock.fs_mtime = time(NULL);
 		sbdirty();
 	}
-	
+
 	/*
 	 * Cleared if any questions answered no. Used to decide if
 	 * the superblock should be marked clean.
@@ -576,7 +576,7 @@ chkdoreload(struct statfs *mntp)
 		/*
 		 * XX: We need the following line until we clean up
 		 * nmount parsing of root mounts and NFS root mounts.
-		 */ 
+		 */
 		build_iovec(&iov, &iovlen, "ro", NULL, 0);
 		if (nmount(iov, iovlen, mntp->f_flags) == 0) {
 			return (0);
@@ -631,9 +631,9 @@ getmntpt(const char *name)
 static void
 usage(void)
 {
-        (void) fprintf(stderr,
-            "usage: %s [-BFprfny] [-b block] [-c level] [-m mode] "
-                        "filesystem ...\n",
-            getprogname());
-        exit(1);
+	(void) fprintf(stderr,
+	    "usage: %s [-BFprfny] [-b block] [-c level] [-m mode] "
+			"filesystem ...\n",
+	    getprogname());
+	exit(1);
 }

Modified: head/sbin/fsck_ffs/pass2.c
==============================================================================
--- head/sbin/fsck_ffs/pass2.c	Wed Apr 27 02:41:26 2011	(r221109)
+++ head/sbin/fsck_ffs/pass2.c	Wed Apr 27 02:55:03 2011	(r221110)
@@ -524,7 +524,7 @@ fix_extraneous(struct inoinfo *inp, stru
 	struct inodesc dotdesc;
 	char oldname[MAXPATHLEN + 1];
 	char newname[MAXPATHLEN + 1];
-	
+
 	/*
 	 * If we have not yet found "..", look it up now so we know
 	 * which inode the directory itself believes is its parent.

Modified: head/sbin/fsck_ffs/suj.c
==============================================================================
--- head/sbin/fsck_ffs/suj.c	Wed Apr 27 02:41:26 2011	(r221109)
+++ head/sbin/fsck_ffs/suj.c	Wed Apr 27 02:55:03 2011	(r221110)
@@ -522,7 +522,7 @@ blk_setmask(struct jblkrec *brec, int *m
  * Determine whether a given block has been reallocated to a new location.
  * Returns a mask of overlapping bits if any frags have been reused or
  * zero if the block has not been re-used and the contents can be trusted.
- * 
+ *
  * This is used to ensure that an orphaned pointer due to truncate is safe
  * to be freed.  The mask value can be used to free partial blocks.
  */
@@ -554,7 +554,7 @@ blk_freemask(ufs2_daddr_t blk, ino_t ino
 		 * exactly it's a new allocation.  If it matches
 		 * exactly this record refers to the current
 		 * location.
-		 */ 
+		 */
 		if (blk_overlaps(brec, blk, frags) == 0)
 			continue;
 		if (blk_equals(brec, ino, lbn, blk, frags) == 1)
@@ -576,7 +576,7 @@ blk_freemask(ufs2_daddr_t blk, ino_t ino
  * It is also not safe to follow an indirect if the cg bitmap has been
  * cleared as a new allocation may write to the block prior to the journal
  * being written.
- * 
+ *
  * Returns 1 if it's safe to follow the indirect and 0 otherwise.
  */
 static int
@@ -718,7 +718,7 @@ indir_blkatoff(ufs2_daddr_t blk, ino_t i
 	base = -(cur + level);
 	for (i = level; i > 0; i--)
 		lbnadd *= NINDIR(fs);
-	if (lbn > 0) 
+	if (lbn > 0)
 		i = (lbn - base) / lbnadd;
 	else
 		i = (-lbn - base) / lbnadd;
@@ -1572,7 +1572,7 @@ ino_trunc(ino_t ino, off_t size)
 	 * last populated lbn is.  We will set the size to this last lbn
 	 * rather than worrying about allocating the final lbn as the kernel
 	 * would've done.  This is consistent with normal fsck behavior.
-	 */ 
+	 */
 	visitlbn = 0;
 	totalfrags = ino_visit(ip, ino, null_visit, VISIT_INDIR | VISIT_EXT);
 	if (size > lblktosize(fs, visitlbn + 1))
@@ -1650,7 +1650,7 @@ ino_check(struct suj_ino *sino)
 	removes = sino->si_nlinkadj;
 	TAILQ_FOREACH(srec, &sino->si_recs, sr_next) {
 		rrec = (struct jrefrec *)srec->sr_rec;
-		isat = ino_isat(rrec->jr_parent, rrec->jr_diroff, 
+		isat = ino_isat(rrec->jr_parent, rrec->jr_diroff,
 		    rrec->jr_ino, &mode, &isdot);
 		if (isat && (mode & IFMT) != (rrec->jr_mode & IFMT))
 			err_suj("Inode mode/directory type mismatch %o != %o\n",
@@ -1952,13 +1952,13 @@ ino_append(union jrec *rec)
 	mvrec = &rec->rec_jmvrec;
 	refrec = &rec->rec_jrefrec;
 	if (debug && mvrec->jm_op == JOP_MVREF)
-		printf("ino move: ino %d, parent %d, diroff %jd, oldoff %jd\n", 
+		printf("ino move: ino %d, parent %d, diroff %jd, oldoff %jd\n",
 		    mvrec->jm_ino, mvrec->jm_parent, mvrec->jm_newoff,
 		    mvrec->jm_oldoff);
 	else if (debug &&
 	    (refrec->jr_op == JOP_ADDREF || refrec->jr_op == JOP_REMREF))
 		printf("ino ref: op %d, ino %d, nlink %d, "
-		    "parent %d, diroff %jd\n", 
+		    "parent %d, diroff %jd\n",
 		    refrec->jr_op, refrec->jr_ino, refrec->jr_nlink,
 		    refrec->jr_parent, refrec->jr_diroff);
 	/*
@@ -2330,7 +2330,7 @@ suj_prune(void)
 		TAILQ_REMOVE(&allsegs, seg, ss_next);
 		TAILQ_INSERT_HEAD(&allsegs, seg, ss_next);
 		newseq = seg->ss_rec.jsr_seq;
-		
+
 	}
 	if (newseq != oldseq) {
 		err_suj("Journal file sequence mismatch %jd != %jd\n",
@@ -2609,7 +2609,7 @@ restart:
 				recn = (void *)((uintptr_t)rec) + i *
 				    real_dev_bsize;
 				if (recn->jsr_seq == rec->jsr_seq &&
-				    recn->jsr_time == rec->jsr_time) 
+				    recn->jsr_time == rec->jsr_time)
 					continue;
 				if (debug)
 					printf("Incomplete record %jd (%d)\n",

Modified: head/sbin/fsck_ffs/utilities.c
==============================================================================
--- head/sbin/fsck_ffs/utilities.c	Wed Apr 27 02:41:26 2011	(r221109)
+++ head/sbin/fsck_ffs/utilities.c	Wed Apr 27 02:55:03 2011	(r221110)
@@ -86,7 +86,7 @@ retry:
 	case S_IFDIR:
 		if (retried)
 			break;
-		
+
 		len = strlen(origname) - 1;
 		if (len > 0 && origname[len] == '/')
 			/* remove trailing slash */

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 03:00:27 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E6C21065673;
	Wed, 27 Apr 2011 03:00:27 +0000 (UTC)
	(envelope-from nwhitehorn@freebsd.org)
Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119])
	by mx1.freebsd.org (Postfix) with ESMTP id 3B8008FC15;
	Wed, 27 Apr 2011 03:00:21 +0000 (UTC)
Received: from localhost (localhost.localdomain [127.0.0.1])
	by mail.icecube.wisc.edu (Postfix) with ESMTP id 26EF058134;
	Tue, 26 Apr 2011 22:00:21 -0500 (CDT)
X-Virus-Scanned: amavisd-new at icecube.wisc.edu
Received: from mail.icecube.wisc.edu ([127.0.0.1])
	by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new,
	port 10030)
	with ESMTP id oh9+6SRQviPB; Tue, 26 Apr 2011 22:00:21 -0500 (CDT)
Received: from wanderer.tachypleus.net (unknown [76.210.65.155])
	by mail.icecube.wisc.edu (Postfix) with ESMTP id 3F3D65811E;
	Tue, 26 Apr 2011 22:00:20 -0500 (CDT)
Message-ID: <4DB786C3.3010607@freebsd.org>
Date: Tue, 26 Apr 2011 22:00:19 -0500
From: Nathan Whitehorn 
User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US;
	rv:1.9.2.15) Gecko/20110317 Thunderbird/3.1.9
MIME-Version: 1.0
To: Daniel O'Connor 
References: <201104240923.p3O9N8QG025386@svn.freebsd.org>
	<20110424161933.GA18775@vniz.net>
	<18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au>
	
	<34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au>
	
	<15C958E3-6CF7-48C4-88C9-2E61AC301657@gsoft.com.au>
In-Reply-To: <15C958E3-6CF7-48C4-88C9-2E61AC301657@gsoft.com.au>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: src-committers@FreeBSD.org, Andrey Chernov ,
	Alexander Motin , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org, Warner Losh 
Subject: Re: svn commit: r220983 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 03:00:27 -0000

On 04/26/11 18:48, Daniel O'Connor wrote:
>
> On 26/04/2011, at 1:31, Warner Losh wrote:
>>> This is why I prefer IDs since they are nominally unique (UFS
>>> ones, GPTs damn well better be :)
>>>
>>> Although I concede it is rather annoying to work out which is
>>> which, or type them out manually..
>>
>> For things like ZFS, UUIDs aren't so bad because it hides them.
>
> Yes, I use GPT with ZFS, it's good :)
>
>> For things like /etc/fstab, I prefer the named approach.  This
>> allows me to survive a newfs on a partition if I have to without
>> having to hack my /etc/fstab.  I have a large /tmp partition at
>> times, and it gets newfs'd if there's a bad problem...
>
> Yeah, but.. IMHO if the installer supports it then it is dramatically
> less painful..
>
> I haven't looked to see how hard it is to add, hopefully I will get
> some time to look RSN and it shouldn't be too difficult.

It's not difficult to add -- the issue is that the mechanism is 
unreliable. It doesn't work for all partition types supporting labels, 
it's hard to figure out what the name of the label provider is in a 
generic way, and the label providers have a nasty habit of disappearing 
periodically when you use the underlying provider for anything. Also, 
retastes don't always work. For example, if I change the label of a GPT 
partition, the label provider does not reflect the change until a disk 
reattach (e.g. a reboot).

If it's a feature that we enable by default, and that the installer 
relies upon, it has to work better than that.
-Nathan

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 03:21:53 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69DD61065672;
	Wed, 27 Apr 2011 03:21:53 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 267E68FC0A;
	Wed, 27 Apr 2011 03:21:53 +0000 (UTC)
Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63])
	(authenticated bits=0)
	by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3R3H4j2041320
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO);
	Tue, 26 Apr 2011 21:17:37 -0600 (MDT) (envelope-from imp@bsdimp.com)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Warner Losh 
In-Reply-To: <201104262202.p3QM2p0K040439@svn.freebsd.org>
Date: Tue, 26 Apr 2011 21:17:37 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <36B3B1AD-2BAE-4325-9186-E388478313E8@bsdimp.com>
References: <201104262202.p3QM2p0K040439@svn.freebsd.org>
To: Doug Barton 
X-Mailer: Apple Mail (2.1084)
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(harmony.bsdimp.com [10.0.0.6]);
	Tue, 26 Apr 2011 21:17:37 -0600 (MDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r221088 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 03:21:53 -0000

Actually, it looks like jhb fixed things so this isn't necessary.

Warner

On Apr 26, 2011, at 4:02 PM, Doug Barton wrote:

> Author: dougb
> Date: Tue Apr 26 22:02:51 2011
> New Revision: 221088
> URL: http://svn.freebsd.org/changeset/base/221088
>=20
> Log:
>  Revert r221053 by replacing WARNS?=3D 3 since it's breaking the build =
on
>  several arches.
>=20
> Modified:
>  head/usr.bin/rlogin/Makefile
>=20
> Modified: head/usr.bin/rlogin/Makefile
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/usr.bin/rlogin/Makefile	Tue Apr 26 21:47:38 2011	=
(r221087)
> +++ head/usr.bin/rlogin/Makefile	Tue Apr 26 22:02:51 2011	=
(r221088)
> @@ -7,4 +7,6 @@ BINOWN=3D	root
> BINMODE=3D4555
> PRECIOUSPROG=3D
>=20
> +WARNS?=3D	3
> +
> .include 
>=20
>=20


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 03:22:15 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B39B1065700;
	Wed, 27 Apr 2011 03:22:15 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 16AED8FC14;
	Wed, 27 Apr 2011 03:22:15 +0000 (UTC)
Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63])
	(authenticated bits=0)
	by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3R3JH5Q041329
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO);
	Tue, 26 Apr 2011 21:19:19 -0600 (MDT) (envelope-from imp@bsdimp.com)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Warner Losh 
In-Reply-To: <20110426222641.GA44259@dragon.NUXI.org>
Date: Tue, 26 Apr 2011 21:19:17 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104260932.44199.jhb@freebsd.org>
	<20110426222641.GA44259@dragon.NUXI.org>
To: obrien@FreeBSD.org
X-Mailer: Apple Mail (2.1084)
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(harmony.bsdimp.com [10.0.0.6]);
	Tue, 26 Apr 2011 21:19:19 -0600 (MDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, John Baldwin 
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 03:22:15 -0000


On Apr 26, 2011, at 4:26 PM, David O'Brien wrote:

> On Tue, Apr 26, 2011 at 09:32:44AM -0400, John Baldwin wrote:
>> On Tuesday, April 26, 2011 12:09:20 am David E. O'Brien wrote:
>>> Author: obrien
>>> Date: Tue Apr 26 04:09:20 2011
>>> New Revision: 221053
>>> URL: http://svn.freebsd.org/changeset/base/221053
>>>=20
>>> Log:
>>>  This builds OK using the parent dir's WARNS=3D6.
>>>  [built on both AMD64 and i386]
>>=20
>> This breaks the tinderbox on at least arm, ia64, mips, and sparc64.
>=20
> Sigh.  Do we yet have ARM, MIPS, or Sparc64 test machines in
> the cluster?  http://www.freebsd.org/internal/machines.html doesn't =
list
> any, but maybe some have been added?

make universe

And don't give me grief about not being able to test...  You can at =
least compile-test things and to not do so when changing WARNS level has =
caused bugs in about 80% of the cases where people have done it before, =
so there's no excuse.

Warner


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 03:22:16 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 578E11065702;
	Wed, 27 Apr 2011 03:22:16 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id E23B18FC17;
	Wed, 27 Apr 2011 03:22:15 +0000 (UTC)
Received: from [10.0.0.63] (63.imp.bsdimp.com [10.0.0.63])
	(authenticated bits=0)
	by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3R3H4j1041320
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO);
	Tue, 26 Apr 2011 21:17:06 -0600 (MDT) (envelope-from imp@bsdimp.com)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Warner Losh 
In-Reply-To: <4DB786C3.3010607@freebsd.org>
Date: Tue, 26 Apr 2011 21:17:04 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201104240923.p3O9N8QG025386@svn.freebsd.org>
	<20110424161933.GA18775@vniz.net>
	<18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au>
	
	<34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au>
	
	<15C958E3-6CF7-48C4-88C9-2E61AC301657@gsoft.com.au>
	<4DB786C3.3010607@freebsd.org>
To: Nathan Whitehorn 
X-Mailer: Apple Mail (2.1084)
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(harmony.bsdimp.com [10.0.0.6]);
	Tue, 26 Apr 2011 21:17:06 -0600 (MDT)
Cc: src-committers@FreeBSD.org, Andrey Chernov ,
	Daniel O'Connor ,
	Alexander Motin , svn-src-head@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r220983 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 03:22:16 -0000


On Apr 26, 2011, at 9:00 PM, Nathan Whitehorn wrote:

> On 04/26/11 18:48, Daniel O'Connor wrote:
>>=20
>> On 26/04/2011, at 1:31, Warner Losh wrote:
>>>> This is why I prefer IDs since they are nominally unique (UFS
>>>> ones, GPTs damn well better be :)
>>>>=20
>>>> Although I concede it is rather annoying to work out which is
>>>> which, or type them out manually..
>>>=20
>>> For things like ZFS, UUIDs aren't so bad because it hides them.
>>=20
>> Yes, I use GPT with ZFS, it's good :)
>>=20
>>> For things like /etc/fstab, I prefer the named approach.  This
>>> allows me to survive a newfs on a partition if I have to without
>>> having to hack my /etc/fstab.  I have a large /tmp partition at
>>> times, and it gets newfs'd if there's a bad problem...
>>=20
>> Yeah, but.. IMHO if the installer supports it then it is dramatically
>> less painful..
>>=20
>> I haven't looked to see how hard it is to add, hopefully I will get
>> some time to look RSN and it shouldn't be too difficult.
>=20
> It's not difficult to add -- the issue is that the mechanism is =
unreliable. It doesn't work for all partition types supporting labels, =
it's hard to figure out what the name of the label provider is in a =
generic way, and the label providers have a nasty habit of disappearing =
periodically when you use the underlying provider for anything. Also, =
retastes don't always work. For example, if I change the label of a GPT =
partition, the label provider does not reflect the change until a disk =
reattach (e.g. a reboot).

I know that for ufs, it works well, except for the root partition which =
requires some dancing to retrofit.  But if you relabel a partition, it =
shows up right away in /dev/ufs/newlbl.  Guess not all of them are that =
reliable.

The new names, and slightly non-deterministic probe order make it more =
important that we shake out the bugs from this as best we can.  I think =
that names/uuid are critical to the future, and we need to fix any =
remaining issues.

> If it's a feature that we enable by default, and that the installer =
relies upon, it has to work better than that.


Thanks for the report.  Who are you working with to resolve these =
issues?  Some of them surprise me, but you speak of them as if they are =
widely known...  Without owners, these issues will languish.

Warner=

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 04:03:04 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9E3241065670;
	Wed, 27 Apr 2011 04:03:04 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8CB688FC0A;
	Wed, 27 Apr 2011 04:03:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R434sV052978;
	Wed, 27 Apr 2011 04:03:04 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R4349e052976;
	Wed, 27 Apr 2011 04:03:04 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201104270403.p3R4349e052976@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Wed, 27 Apr 2011 04:03:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221112 -
	head/sys/cddl/contrib/opensolaris/common/atomic/ia64
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 04:03:04 -0000

Author: marcel
Date: Wed Apr 27 04:03:04 2011
New Revision: 221112
URL: http://svn.freebsd.org/changeset/base/221112

Log:
  Fix copy-paste bug.

Modified:
  head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S

Modified: head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S	Wed Apr 27 03:16:01 2011	(r221111)
+++ head/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S	Wed Apr 27 04:03:04 2011	(r221112)
@@ -39,7 +39,7 @@ ENTRY(atomic_cas_32, 3)
 	cmpxchg4.acq    r8 = [r32], r34, ar.ccv
 	;;
 	br.ret.sptk     rp
-END(atomic_cas_64)
+END(atomic_cas_32)
 
 /*
  * uint64_t atomic_cas_64(volatile uint64_t *p, uint64_t cmp, uint64_t v)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 07:03:43 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60A36106566C;
	Wed, 27 Apr 2011 07:03:43 +0000 (UTC)
	(envelope-from pawel@dawidek.net)
Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60])
	by mx1.freebsd.org (Postfix) with ESMTP id B6EDD8FC12;
	Wed, 27 Apr 2011 07:03:42 +0000 (UTC)
Received: by mail.garage.freebsd.pl (Postfix, from userid 65534)
	id 01D1F45CD9; Wed, 27 Apr 2011 09:03:40 +0200 (CEST)
Received: from localhost (58.wheelsystems.com [83.12.187.58])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.garage.freebsd.pl (Postfix) with ESMTP id 166D445C98;
	Wed, 27 Apr 2011 09:03:35 +0200 (CEST)
Date: Wed, 27 Apr 2011 09:03:24 +0200
From: Pawel Jakub Dawidek 
To: Warner Losh 
Message-ID: <20110427070324.GB2185@garage.freebsd.pl>
References: <201104240923.p3O9N8QG025386@svn.freebsd.org>
	<20110424161933.GA18775@vniz.net>
	<18B3AE1E-467E-4B23-81B9-AB1EDEFE1F7A@gsoft.com.au>
	
	<34A34338-79E0-435E-9BF1-614D10FC9FC7@gsoft.com.au>
	
	<15C958E3-6CF7-48C4-88C9-2E61AC301657@gsoft.com.au>
	<4DB786C3.3010607@freebsd.org>
	
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="2oS5YaxWCcQjTEyO"
Content-Disposition: inline
In-Reply-To: 
X-OS: FreeBSD 9.0-CURRENT amd64
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on 
	mail.garage.freebsd.pl
X-Spam-Level: 
X-Spam-Status: No, score=-3.9 required=4.5 tests=ALL_TRUSTED,BAYES_00,
	RCVD_IN_SORBS_DUL autolearn=ham version=3.0.4
Cc: src-committers@FreeBSD.org, Andrey Chernov ,
	Daniel O'Connor , Alexander Motin ,
	Nathan Whitehorn ,
	svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org
Subject: Re: svn commit: r220983 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 07:03:43 -0000


--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 26, 2011 at 09:17:04PM -0600, Warner Losh wrote:
> > It's not difficult to add -- the issue is that the mechanism is unrelia=
ble. It doesn't work for all partition types supporting labels, it's hard t=
o figure out what the name of the label provider is in a generic way, and t=
he label providers have a nasty habit of disappearing periodically when you=
 use the underlying provider for anything. Also, retastes don't always work=
=2E For example, if I change the label of a GPT partition, the label provid=
er does not reflect the change until a disk reattach (e.g. a reboot).
>=20
> I know that for ufs, it works well, except for the root partition which r=
equires some dancing to retrofit.  But if you relabel a partition, it shows=
 up right away in /dev/ufs/newlbl.  Guess not all of them are that reliable.
>=20
> The new names, and slightly non-deterministic probe order make it more im=
portant that we shake out the bugs from this as best we can.  I think that =
names/uuid are critical to the future, and we need to fix any remaining iss=
ues.

Labels are kinda tricky and they differ. For example UFS labels or IDs
don't play with tasting well (they were never designed to play well with
such mechanism). You can create file system that is smaller than
underlying provider (newfs -s). How do we know that label is assigned to
the provider we are tasing and not to some other provider?  Currently we
check that based on recorded file system size and provider size, so we
won't create label/id on ad0s1 instead of ad0s1a, but because of this we
won't create label/id at all if file system was created with the -s
option.

GPT labels and IDs should be implemented as part of GPART class and not
GLABEL. Currently if you modify GPT label for a partition in ad0 there
is no write to, eg. ad0p1, so there is no taste event which allows
glabel to detect the change, so the label is not updated in /dev/gpt/.
There is a patch on freebsd-geom@ to move GPT labels/IDs to GPART.

--=20
Pawel Jakub Dawidek                       http://www.wheelsystems.com
FreeBSD committer                         http://www.FreeBSD.org
Am I Evil? Yes, I Am!                     http://yomoli.com

--2oS5YaxWCcQjTEyO
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (FreeBSD)

iEYEARECAAYFAk23v7sACgkQForvXbEpPzT3tACgzVrAoS/NKzQmeGOOBEPe69M4
N8EAn3v8hznAseuiUjPKBweg6HUi56d5
=RIrJ
-----END PGP SIGNATURE-----

--2oS5YaxWCcQjTEyO--

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 07:25:07 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3C3F106564A;
	Wed, 27 Apr 2011 07:25:06 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25])
	by mx1.freebsd.org (Postfix) with ESMTP id A50208FC13;
	Wed, 27 Apr 2011 07:25:06 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id DE86525D3888;
	Wed, 27 Apr 2011 07:25:05 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id 2E845159DD41;
	Wed, 27 Apr 2011 07:25:05 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id bKTA12IaPuFc; Wed, 27 Apr 2011 07:25:04 +0000 (UTC)
Received: from orange-en1.sbone.de (orange-en1.sbone.de
	[IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id 0D546159DD31;
	Wed, 27 Apr 2011 07:25:03 +0000 (UTC)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: "Bjoern A. Zeeb" 
In-Reply-To: <201104270010.p3R0AQQv044866@svn.freebsd.org>
Date: Wed, 27 Apr 2011 07:25:03 +0000
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201104270010.p3R0AQQv044866@svn.freebsd.org>
To: Alexander Motin 
X-Mailer: Apple Mail (2.1084)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221101 - in head/sys/geom: . concat journal mirror
	raid3 shsec stripe virstor
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 07:25:07 -0000

On Apr 27, 2011, at 12:10 AM, Alexander Motin wrote:

Hi Alexander,

> Author: mav
> Date: Wed Apr 27 00:10:26 2011
> New Revision: 221101
> URL: http://svn.freebsd.org/changeset/base/221101
>=20
> Log:
>  Implement relaxed comparision for hardcoded provider names to make it
>  ignore adX/adaY difference in both directions to simplify migration =
to
>  the CAM-based ATA or back.


Thanks a lot for this and the earlier changes in such a quick time.  =
Very much appreciated!
I'll try to test them as good as I can over the next weeks and am happy =
this got sorted:)

Bjoern

--=20
Bjoern A. Zeeb                                 You have to have visions!
         Stop bit received. Insert coin for new address family.


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 08:03:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A562A1065674;
	Wed, 27 Apr 2011 08:03:50 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 3AE988FC17;
	Wed, 27 Apr 2011 08:03:49 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3R83Pku054668
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 27 Apr 2011 11:03:25 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	p3R83PPR050615; Wed, 27 Apr 2011 11:03:25 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3R83PMj050614; 
	Wed, 27 Apr 2011 11:03:25 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Wed, 27 Apr 2011 11:03:25 +0300
From: Kostik Belousov 
To: Alexander Motin 
Message-ID: <20110427080325.GV48734@deviant.kiev.zoral.com.ua>
References: <201104270010.p3R0AQQv044866@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="yOCDj6dCdxu1mn4c"
Content-Disposition: inline
In-Reply-To: <201104270010.p3R0AQQv044866@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221101 - in head/sys/geom: . concat journal mirror
	raid3 shsec stripe virstor
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 08:03:50 -0000


--yOCDj6dCdxu1mn4c
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 27, 2011 at 12:10:26AM +0000, Alexander Motin wrote:
> Author: mav
> Date: Wed Apr 27 00:10:26 2011
> New Revision: 221101
> URL: http://svn.freebsd.org/changeset/base/221101
>=20
> Log:
>   Implement relaxed comparision for hardcoded provider names to make it
>   ignore adX/adaY difference in both directions to simplify migration to
>   the CAM-based ATA or back.
>=20
> Modified:
>   head/sys/geom/concat/g_concat.c
>   head/sys/geom/geom.h
>   head/sys/geom/geom_subr.c
>   head/sys/geom/journal/g_journal.c
>   head/sys/geom/mirror/g_mirror.c
>   head/sys/geom/raid3/g_raid3.c
>   head/sys/geom/shsec/g_shsec.c
>   head/sys/geom/stripe/g_stripe.c
>   head/sys/geom/virstor/g_virstor.c
>=20
> Modified: head/sys/geom/concat/g_concat.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/geom/concat/g_concat.c	Tue Apr 26 23:00:32 2011	(r221100)
> +++ head/sys/geom/concat/g_concat.c	Wed Apr 27 00:10:26 2011	(r221101)
> @@ -678,7 +678,8 @@ g_concat_taste(struct g_class *mp, struc
>  	if (md.md_version < 4)
>  		md.md_provsize =3D pp->mediasize;
> =20
> -	if (md.md_provider[0] !=3D '\0' && strcmp(md.md_provider, pp->name) !=
=3D 0)
> +	if (md.md_provider[0] !=3D '\0' &&
> +	    !g_compare_names(md.md_provider, pp->name))
>  		return (NULL);
>  	if (md.md_provsize !=3D pp->mediasize)
>  		return (NULL);
>=20
> Modified: head/sys/geom/geom.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/geom/geom.h	Tue Apr 26 23:00:32 2011	(r221100)
> +++ head/sys/geom/geom.h	Wed Apr 27 00:10:26 2011	(r221101)
> @@ -238,6 +238,7 @@ void g_waitidlelock(void);
>  /* geom_subr.c */
>  int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl);
>  int g_attach(struct g_consumer *cp, struct g_provider *pp);
> +int g_compare_names(const char *namea, const char *nameb);
>  void g_destroy_consumer(struct g_consumer *cp);
>  void g_destroy_geom(struct g_geom *pp);
>  void g_destroy_provider(struct g_provider *pp);
>=20
> Modified: head/sys/geom/geom_subr.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/geom/geom_subr.c	Tue Apr 26 23:00:32 2011	(r221100)
> +++ head/sys/geom/geom_subr.c	Wed Apr 27 00:10:26 2011	(r221101)
> @@ -1017,6 +1017,43 @@ g_getattr__(const char *attr, struct g_c
>  	return (0);
>  }
> =20
> +static int
> +g_get_device_prefix_len(const char *name)
> +{
> +	int len;
> +
> +	if (strncmp(name, "ada", 3) =3D=3D 0)
> +		len =3D 3;
> +	else if (strncmp(name, "ad", 2) =3D=3D 0)
> +		len =3D 2;
> +	else
> +		return (0);
> +	if (name[len] < '0' || name[len] > '9')
> +		return (0);
> +	do {
> +		len++;
> +	} while (name[len] >=3D '0' && name[len] <=3D '9');
> +	return (len);
> +}
> +
> +int
> +g_compare_names(const char *namea, const char *nameb)
> +{
> +	int deva, devb;
> +
> +	if (strcmp(namea, nameb) =3D=3D 0)
> +		return (1);
> +	deva =3D g_get_device_prefix_len(namea);
> +	if (deva =3D=3D 0)
> +		return (0);
> +	devb =3D g_get_device_prefix_len(nameb);
> +	if (devb =3D=3D 0)
> +		return (0);
> +	if (strcmp(namea + deva, nameb + devb) =3D=3D 0)
> +		return (1);
> +	return (0);
> +}
> +
This is most likely my misunderstanding of things.

Can we have a legitimate situation where both ada* and ad* devices coexist
on the same system ? E.g. on-board AHCI and legacy PATA controller ?

Wouldn't this hack then wreak the havoc ? Can the hack be put under the
control of some tunable ?

--yOCDj6dCdxu1mn4c
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk23zcwACgkQC3+MBN1Mb4hrjQCeP+S6FfrYF/fQOi73swqlLrY7
ueEAmwRJfT8TYREdrolXGYGK3Noj4sI8
=orH1
-----END PGP SIGNATURE-----

--yOCDj6dCdxu1mn4c--

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 08:24:02 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0568B106564A;
	Wed, 27 Apr 2011 08:24:02 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 312C38FC1D;
	Wed, 27 Apr 2011 08:24:00 +0000 (UTC)
Received: by bwz12 with SMTP id 12so1702754bwz.13
	for ; Wed, 27 Apr 2011 01:24:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:sender:message-id:date:from:user-agent
	:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=uil9GRazJPvsH8okLg/FR/cuMm5pHj6k6enW3mTSXgk=;
	b=TXEJ8ag16V4m1ViQ+mc3vKKzEzD4GJ5XZfbtF43yW212K8fyjIaYDfeIEDqhIS+DYF
	9mBY4ckNuM4mffzFoRv3ozERV/UCIzJA467gjrlq30hsRGVDAiU0p+taFMnUagAz8fey
	+4xqJOPh/8OICBHslyv8TFxrRt5SIErT2agWQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=o4yOGr06Yo8neg57WRy66WD97wPnJBRodSKHdhigLwNdzS4FdhJF1adcSogcQL0SnY
	GZTJVwP5k2Mssf40v55EnbVyuzsU8X6F/BsGg2qSs2a41RAFG2Diu8gcjklmCGhm60XF
	lQ0SiOM4ixt0U5O332b59aF+qDMhoCbMbL7NI=
Received: by 10.204.71.193 with SMTP id i1mr1760293bkj.102.1303892640022;
	Wed, 27 Apr 2011 01:24:00 -0700 (PDT)
Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id w3sm281681bkt.5.2011.04.27.01.23.58
	(version=SSLv3 cipher=OTHER); Wed, 27 Apr 2011 01:23:59 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4DB7D296.7020300@FreeBSD.org>
Date: Wed, 27 Apr 2011 11:23:50 +0300
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.23 (X11/20091212)
MIME-Version: 1.0
To: Kostik Belousov 
References: <201104270010.p3R0AQQv044866@svn.freebsd.org>
	<20110427080325.GV48734@deviant.kiev.zoral.com.ua>
In-Reply-To: <20110427080325.GV48734@deviant.kiev.zoral.com.ua>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221101 - in head/sys/geom: . concat journal mirror
 raid3 shsec stripe virstor
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 08:24:02 -0000

Kostik Belousov wrote:
> On Wed, Apr 27, 2011 at 12:10:26AM +0000, Alexander Motin wrote:
>> Author: mav
>> Date: Wed Apr 27 00:10:26 2011
>> New Revision: 221101
>> URL: http://svn.freebsd.org/changeset/base/221101
>>
>> Log:
>>   Implement relaxed comparision for hardcoded provider names to make it
>>   ignore adX/adaY difference in both directions to simplify migration to
>>   the CAM-based ATA or back.
>>
>> Modified:
>>   head/sys/geom/concat/g_concat.c
>>   head/sys/geom/geom.h
>>   head/sys/geom/geom_subr.c
>>   head/sys/geom/journal/g_journal.c
>>   head/sys/geom/mirror/g_mirror.c
>>   head/sys/geom/raid3/g_raid3.c
>>   head/sys/geom/shsec/g_shsec.c
>>   head/sys/geom/stripe/g_stripe.c
>>   head/sys/geom/virstor/g_virstor.c
>>
>> Modified: head/sys/geom/concat/g_concat.c
>> ==============================================================================
>> --- head/sys/geom/concat/g_concat.c	Tue Apr 26 23:00:32 2011	(r221100)
>> +++ head/sys/geom/concat/g_concat.c	Wed Apr 27 00:10:26 2011	(r221101)
>> @@ -678,7 +678,8 @@ g_concat_taste(struct g_class *mp, struc
>>  	if (md.md_version < 4)
>>  		md.md_provsize = pp->mediasize;
>>  
>> -	if (md.md_provider[0] != '\0' && strcmp(md.md_provider, pp->name) != 0)
>> +	if (md.md_provider[0] != '\0' &&
>> +	    !g_compare_names(md.md_provider, pp->name))
>>  		return (NULL);
>>  	if (md.md_provsize != pp->mediasize)
>>  		return (NULL);
>>
>> Modified: head/sys/geom/geom.h
>> ==============================================================================
>> --- head/sys/geom/geom.h	Tue Apr 26 23:00:32 2011	(r221100)
>> +++ head/sys/geom/geom.h	Wed Apr 27 00:10:26 2011	(r221101)
>> @@ -238,6 +238,7 @@ void g_waitidlelock(void);
>>  /* geom_subr.c */
>>  int g_access(struct g_consumer *cp, int nread, int nwrite, int nexcl);
>>  int g_attach(struct g_consumer *cp, struct g_provider *pp);
>> +int g_compare_names(const char *namea, const char *nameb);
>>  void g_destroy_consumer(struct g_consumer *cp);
>>  void g_destroy_geom(struct g_geom *pp);
>>  void g_destroy_provider(struct g_provider *pp);
>>
>> Modified: head/sys/geom/geom_subr.c
>> ==============================================================================
>> --- head/sys/geom/geom_subr.c	Tue Apr 26 23:00:32 2011	(r221100)
>> +++ head/sys/geom/geom_subr.c	Wed Apr 27 00:10:26 2011	(r221101)
>> @@ -1017,6 +1017,43 @@ g_getattr__(const char *attr, struct g_c
>>  	return (0);
>>  }
>>  
>> +static int
>> +g_get_device_prefix_len(const char *name)
>> +{
>> +	int len;
>> +
>> +	if (strncmp(name, "ada", 3) == 0)
>> +		len = 3;
>> +	else if (strncmp(name, "ad", 2) == 0)
>> +		len = 2;
>> +	else
>> +		return (0);
>> +	if (name[len] < '0' || name[len] > '9')
>> +		return (0);
>> +	do {
>> +		len++;
>> +	} while (name[len] >= '0' && name[len] <= '9');
>> +	return (len);
>> +}
>> +
>> +int
>> +g_compare_names(const char *namea, const char *nameb)
>> +{
>> +	int deva, devb;
>> +
>> +	if (strcmp(namea, nameb) == 0)
>> +		return (1);
>> +	deva = g_get_device_prefix_len(namea);
>> +	if (deva == 0)
>> +		return (0);
>> +	devb = g_get_device_prefix_len(nameb);
>> +	if (devb == 0)
>> +		return (0);
>> +	if (strcmp(namea + deva, nameb + devb) == 0)
>> +		return (1);
>> +	return (0);
>> +}
>> +
> This is most likely my misunderstanding of things.
> 
> Can we have a legitimate situation where both ada* and ad* devices coexist
> on the same system ? E.g. on-board AHCI and legacy PATA controller ?

Yes, we can and sometimes do. But the new GENERIC kernels in CURRENT
switch everything to the adaX.

> Wouldn't this hack then wreak the havoc ? Can the hack be put under the
> control of some tunable ?

I can't imagine useful situation when device name part of the hardcoded
provider name is important. Only partition name sometimes is.

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 08:53:52 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92378106564A;
	Wed, 27 Apr 2011 08:53:52 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8334F8FC08;
	Wed, 27 Apr 2011 08:53:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R8rqVs062152;
	Wed, 27 Apr 2011 08:53:52 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R8rqSm062150;
	Wed, 27 Apr 2011 08:53:52 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201104270853.p3R8rqSm062150@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 27 Apr 2011 08:53:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221114 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 08:53:52 -0000

Author: mav
Date: Wed Apr 27 08:53:52 2011
New Revision: 221114
URL: http://svn.freebsd.org/changeset/base/221114

Log:
  Add obvious note that CAM drivers are required for using CAM ATA.

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Apr 27 04:11:18 2011	(r221113)
+++ head/UPDATING	Wed Apr 27 08:53:52 2011	(r221114)
@@ -41,6 +41,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	module work as CAM driver supporting legacy ATA controllers. Device ata
 	still can be used in modular fashion (atacore + ...). Modules atadisk
 	and atapi* are not used and won't affect operation in ATA_CAM mode.
+	Note that to use CAM-based ATA kernel should include CAM devices
+	scbus, pass, da (or explicitly ada), cd and optionally others. All of
+	them are parts of the cam module.
 
 	ataraid(4) functionality is now supported by the RAID GEOM class.
 	To use it you can load geom_raid kernel module and use graid(8) tool

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 08:57:13 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 38A64106564A;
	Wed, 27 Apr 2011 08:57:13 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 293A18FC0C;
	Wed, 27 Apr 2011 08:57:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3R8vDxR062296;
	Wed, 27 Apr 2011 08:57:13 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3R8vDWV062294;
	Wed, 27 Apr 2011 08:57:13 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201104270857.p3R8vDWV062294@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Wed, 27 Apr 2011 08:57:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221115 - head/contrib/less
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 08:57:13 -0000

Author: obrien
Date: Wed Apr 27 08:57:12 2011
New Revision: 221115
URL: http://svn.freebsd.org/changeset/base/221115

Log:
  Be clear of what licensing terms we are using.

Deleted:
  head/contrib/less/COPYING
Modified:
  head/contrib/less/README

Modified: head/contrib/less/README
==============================================================================
--- head/contrib/less/README	Wed Apr 27 08:53:52 2011	(r221114)
+++ head/contrib/less/README	Wed Apr 27 08:57:12 2011	(r221115)
@@ -1,3 +1,11 @@
+**************************************************************************
+**************************************************************************
+**                                                                      **
+** The FreeBSD Project has chosen to redistribute and modify Less under **
+** the 'Less License' (as described in the 'LICENSE' file).             **
+**                                                                      **
+**************************************************************************
+**************************************************************************
 
                             Less, version 436
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 12:12:23 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2C5C61065673;
	Wed, 27 Apr 2011 12:12:23 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1925D8FC14;
	Wed, 27 Apr 2011 12:12:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RCCM1d071036;
	Wed, 27 Apr 2011 12:12:22 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RCCM32071034;
	Wed, 27 Apr 2011 12:12:22 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201104271212.p3RCCM32071034@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 27 Apr 2011 12:12:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221118 - head/share/misc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 12:12:23 -0000

Author: pluknet
Date: Wed Apr 27 12:12:22 2011
New Revision: 221118
URL: http://svn.freebsd.org/changeset/base/221118

Log:
  Add DragonFly 2.10.1 release.

Modified:
  head/share/misc/bsd-family-tree

Modified: head/share/misc/bsd-family-tree
==============================================================================
--- head/share/misc/bsd-family-tree	Wed Apr 27 09:35:40 2011	(r221117)
+++ head/share/misc/bsd-family-tree	Wed Apr 27 12:12:22 2011	(r221118)
@@ -245,7 +245,7 @@ FreeBSD 5.2           |      |          
  |     |        |     |      |    |        OpenBSD 4.8                 |
  |     |        |     |      | NetBSD 5.1      |                       |
  |  FreeBSD  FreeBSD  |      |                 |                       |
- |    8.2      7.4    |      |                 |                       |
+ |    8.2      7.4    |      |                 |               DragonFly 2.10.1
  |     v              |      |                 |                       |
  |                    |      |                 |                       |
 FreeBSD 9 -current    |  NetBSD -current  OpenBSD -current             |
@@ -532,6 +532,7 @@ OpenBSD 4.8		2010-11-01 [OBD]
 NetBSD 5.1		2010-11-19 [NBD]
 FreeBSD 7.4		2011-02-24 [FBD]
 FreeBSD 8.2		2011-02-24 [FBD]
+DragonFly 2.10.1	2011-04-26 [DFB]
 
 Bibliography
 ------------------------

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 14:58:06 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9B6EC106566B;
	Wed, 27 Apr 2011 14:58:06 +0000 (UTC)
	(envelope-from pluknet@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8B4808FC18;
	Wed, 27 Apr 2011 14:58:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3REw66E076273;
	Wed, 27 Apr 2011 14:58:06 GMT (envelope-from pluknet@svn.freebsd.org)
Received: (from pluknet@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3REw6RN076271;
	Wed, 27 Apr 2011 14:58:06 GMT (envelope-from pluknet@svn.freebsd.org)
Message-Id: <201104271458.p3REw6RN076271@svn.freebsd.org>
From: Sergey Kandaurov 
Date: Wed, 27 Apr 2011 14:58:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221119 - head/usr.sbin/mfiutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 14:58:06 -0000

Author: pluknet
Date: Wed Apr 27 14:58:06 2011
New Revision: 221119
URL: http://svn.freebsd.org/changeset/base/221119

Log:
  Fix typo in "continuously" argument used in patrol auto command.
  
  Obtained from:	Sascha Wildner 
  Approved by:	jhb
  MFC after:	3 days

Modified:
  head/usr.sbin/mfiutil/mfi_patrol.c

Modified: head/usr.sbin/mfiutil/mfi_patrol.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_patrol.c	Wed Apr 27 12:12:22 2011	(r221118)
+++ head/usr.sbin/mfiutil/mfi_patrol.c	Wed Apr 27 14:58:06 2011	(r221119)
@@ -252,7 +252,7 @@ patrol_config(int ac, char **av)
 	if (strcasecmp(av[1], "auto") == 0) {
 		op_mode = MFI_PR_OPMODE_AUTO;
 		if (ac > 2) {
-			if (strcasecmp(av[2], "continously") == 0)
+			if (strcasecmp(av[2], "continuously") == 0)
 				exec_freq = 0xffffffff;
 			else {
 				val = strtol(av[2], &cp, 0);

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 15:01:04 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C293E106564A;
	Wed, 27 Apr 2011 15:01:04 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 93AD68FC1D;
	Wed, 27 Apr 2011 15:01:04 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 36BE046B53;
	Wed, 27 Apr 2011 11:01:04 -0400 (EDT)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id AEF448A01B;
	Wed, 27 Apr 2011 11:01:03 -0400 (EDT)
From: John Baldwin 
To: obrien@freebsd.org
Date: Wed, 27 Apr 2011 10:48:33 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; )
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104260932.44199.jhb@freebsd.org>
	<20110426222641.GA44259@dragon.NUXI.org>
In-Reply-To: <20110426222641.GA44259@dragon.NUXI.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201104271048.33325.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Wed, 27 Apr 2011 11:01:03 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 15:01:04 -0000

On Tuesday, April 26, 2011 6:26:41 pm David O'Brien wrote:
> On Tue, Apr 26, 2011 at 09:32:44AM -0400, John Baldwin wrote:
> > On Tuesday, April 26, 2011 12:09:20 am David E. O'Brien wrote:
> > > Author: obrien
> > > Date: Tue Apr 26 04:09:20 2011
> > > New Revision: 221053
> > > URL: http://svn.freebsd.org/changeset/base/221053
> > > 
> > > Log:
> > >   This builds OK using the parent dir's WARNS=6.
> > >   [built on both AMD64 and i386]
> > 
> > This breaks the tinderbox on at least arm, ia64, mips, and sparc64.
> 
> Sigh.  Do we yet have ARM, MIPS, or Sparc64 test machines in
> the cluster?  http://www.freebsd.org/internal/machines.html doesn't list
> any, but maybe some have been added?

Umm, I just did:

make TARGET=ia64 toolchain
make TARGET=ia64 buildenv
cd usr.bin/rlogin
make

to test my fixes to rlogin.  For changing WARNS, 'make universe' works well (I 
have one running right now before I re-enable this change).

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 16:43:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BC44C106566B;
	Wed, 27 Apr 2011 16:43:03 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AD55D8FC1A;
	Wed, 27 Apr 2011 16:43:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RGh3Bj079576;
	Wed, 27 Apr 2011 16:43:03 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RGh3rP079572;
	Wed, 27 Apr 2011 16:43:03 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201104271643.p3RGh3rP079572@svn.freebsd.org>
From: Attilio Rao 
Date: Wed, 27 Apr 2011 16:43:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221121 - in head/sys: ddb dev/watchdog sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 16:43:03 -0000

Author: attilio
Date: Wed Apr 27 16:43:03 2011
New Revision: 221121
URL: http://svn.freebsd.org/changeset/base/221121

Log:
  - Add the possibility to reuse the already last used timeout when patting
    the watchdog, via the watchdog(9) interface.
    For that, the WD_LASTVAL bitwise operation is used. It is mutually
    exclusive with any explicit timout passing to the watchdogs.
    The last timeout can be returned via the wdog_kern_last_timeout()
    KPI.
  - Add the possibility to pat the watchdogs installed via the watchdog(9)
    interface from the kernel.
    In order to do that the new KPI wdog_kern_pat() is offered and it does
    accept normalized nanoseconds or WD_LASTVAL.
  - Avoid to pass WD_ACTIVE down in the watchdog handlers. All the control
    bit processing should over to the upper layer functions and not passed
    down to the handlers at all.
  
  These changes are intended to be used in order to fix up the watchdog
  tripping in situation when the userland is busted, but protection is still
  wanted (examples: shutdown syncing / disk dumping).
  
  Sponsored by:	Sandvine Incorporated
  Reviewed by:	emaste, des, cognet
  MFC after:	2 weeks

Modified:
  head/sys/ddb/db_command.c
  head/sys/dev/watchdog/watchdog.c
  head/sys/sys/watchdog.h

Modified: head/sys/ddb/db_command.c
==============================================================================
--- head/sys/ddb/db_command.c	Wed Apr 27 16:16:01 2011	(r221120)
+++ head/sys/ddb/db_command.c	Wed Apr 27 16:43:03 2011	(r221121)
@@ -724,14 +724,6 @@ db_watchdog(dummy1, dummy2, dummy3, dumm
 	} else if ((tout & WD_INTERVAL) == WD_TO_NEVER) {
 		db_error("Out of range watchdog interval\n");
 		return;
-	} else {
-
-		/*
-		 * XXX: Right now we only support WD_ACTIVE, in the future we
-		 * may be possibly needing a more convoluted function for
-		 * dealing with different cases.
-		 */
-		tout |= WD_ACTIVE;
 	}
 	EVENTHANDLER_INVOKE(watchdog_list, tout, &i);
 }

Modified: head/sys/dev/watchdog/watchdog.c
==============================================================================
--- head/sys/dev/watchdog/watchdog.c	Wed Apr 27 16:16:01 2011	(r221120)
+++ head/sys/dev/watchdog/watchdog.c	Wed Apr 27 16:43:03 2011	(r221121)
@@ -40,35 +40,73 @@ __FBSDID("$FreeBSD$");
 #include 
 
 static struct cdev *wd_dev;
+static volatile u_int wd_last_u;
+
+static int
+kern_do_pat(u_int utim)
+{
+	int error;
+
+	if ((utim & WD_LASTVAL) != 0 && (utim & WD_INTERVAL) > 0)
+		return (EINVAL);
+
+	if ((utim & WD_LASTVAL) != 0) {
+		MPASS((wd_last_u & ~WD_INTERVAL) == 0);
+		utim &= ~WD_LASTVAL;
+		utim |= wd_last_u;
+	} else
+		wd_last_u = (utim & WD_INTERVAL);
+	if ((utim & WD_INTERVAL) == WD_TO_NEVER) {
+		utim = 0;
+
+		/* Assume all is well; watchdog signals failure. */
+		error = 0;
+	} else {
+		/* Assume no watchdog available; watchdog flags success */
+		error = EOPNOTSUPP;
+	}
+	EVENTHANDLER_INVOKE(watchdog_list, utim, &error);
+	return (error);
+}
 
 static int
 wd_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data,
     int flags __unused, struct thread *td)
 {
-	int error;
 	u_int u;
 
 	if (cmd != WDIOCPATPAT)
 		return (ENOIOCTL);
 	u = *(u_int *)data;
-	if (u & ~(WD_ACTIVE | WD_PASSIVE | WD_INTERVAL))
+	if (u & ~(WD_ACTIVE | WD_PASSIVE | WD_LASTVAL | WD_INTERVAL))
 		return (EINVAL);
 	if ((u & (WD_ACTIVE | WD_PASSIVE)) == (WD_ACTIVE | WD_PASSIVE))
 		return (EINVAL);
-	if ((u & (WD_ACTIVE | WD_PASSIVE)) == 0 && (u & WD_INTERVAL) > 0)
+	if ((u & (WD_ACTIVE | WD_PASSIVE)) == 0 && ((u & WD_INTERVAL) > 0 ||
+	    (u & WD_LASTVAL) != 0))
 		return (EINVAL);
 	if (u & WD_PASSIVE)
 		return (ENOSYS);	/* XXX Not implemented yet */
-	if ((u & WD_INTERVAL) == WD_TO_NEVER) {
-		u = 0;
-		/* Assume all is well; watchdog signals failure. */
-		error = 0;
-	} else {
-		/* Assume no watchdog available; watchdog flags success */
-		error = EOPNOTSUPP;
-	}
-	EVENTHANDLER_INVOKE(watchdog_list, u, &error);
-	return (error);
+	u &= ~(WD_ACTIVE | WD_PASSIVE);
+
+	return (kern_do_pat(u));
+}
+
+u_int
+wdog_kern_last_timeout(void)
+{
+
+	return (wd_last_u);
+}
+
+int
+wdog_kern_pat(u_int utim)
+{
+
+	if (utim & ~(WD_LASTVAL | WD_INTERVAL))
+		return (EINVAL);
+
+	return (kern_do_pat(utim));
 }
 
 static struct cdevsw wd_cdevsw = {

Modified: head/sys/sys/watchdog.h
==============================================================================
--- head/sys/sys/watchdog.h	Wed Apr 27 16:16:01 2011	(r221120)
+++ head/sys/sys/watchdog.h	Wed Apr 27 16:43:03 2011	(r221121)
@@ -50,6 +50,12 @@
 	 * right to the kernel.
  	 */
 
+#define WD_LASTVAL	0x0200000
+	/*
+	 * Use the already last used timeout value.
+	 * The kernel will use as timeout the last valid timeout provided.
+ 	 */
+
 #define WD_INTERVAL	0x00000ff
 	/*
 	 * Mask for duration bits.
@@ -78,6 +84,9 @@
 typedef void (*watchdog_fn)(void *, u_int, int *);
 
 EVENTHANDLER_DECLARE(watchdog_list, watchdog_fn);
+
+u_int	wdog_kern_last_timeout(void);
+int	wdog_kern_pat(u_int utim);
 #endif
 
 #endif /* _SYS_WATCHDOG_H */

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 17:36:37 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E53DB106566B;
	Wed, 27 Apr 2011 17:36:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD9BE8FC18;
	Wed, 27 Apr 2011 17:36:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RHabAV081402;
	Wed, 27 Apr 2011 17:36:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RHab6c081400;
	Wed, 27 Apr 2011 17:36:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104271736.p3RHab6c081400@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 27 Apr 2011 17:36:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221123 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 17:36:38 -0000

Author: jhb
Date: Wed Apr 27 17:36:37 2011
New Revision: 221123
URL: http://svn.freebsd.org/changeset/base/221123

Log:
  Raise rlogin back to a WARNS level of 6.
  
  Tested by:	make universe

Modified:
  head/usr.bin/rlogin/Makefile

Modified: head/usr.bin/rlogin/Makefile
==============================================================================
--- head/usr.bin/rlogin/Makefile	Wed Apr 27 17:07:22 2011	(r221122)
+++ head/usr.bin/rlogin/Makefile	Wed Apr 27 17:36:37 2011	(r221123)
@@ -7,6 +7,4 @@ BINOWN=	root
 BINMODE=4555
 PRECIOUSPROG=
 
-WARNS?=	3
-
 .include 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 17:51:52 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52E871065670;
	Wed, 27 Apr 2011 17:51:52 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 41EDA8FC0A;
	Wed, 27 Apr 2011 17:51:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RHpqlf081925;
	Wed, 27 Apr 2011 17:51:52 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RHpp6H081910;
	Wed, 27 Apr 2011 17:51:51 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104271751.p3RHpp6H081910@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 27 Apr 2011 17:51:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221124 - in head: . sbin/mount sbin/mount_nfs
	sys/amd64/conf sys/fs/nfsclient sys/i386/conf sys/ia64/conf
	sys/nfsclient sys/pc98/conf sys/powerpc/conf sys/sparc64/conf
	sys/sun4v/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 17:51:52 -0000

Author: rmacklem
Date: Wed Apr 27 17:51:51 2011
New Revision: 221124
URL: http://svn.freebsd.org/changeset/base/221124

Log:
  This patch changes head so that the default NFS client is now the new
  NFS client (which I guess is no longer experimental). The fstype "newnfs"
  is now "nfs" and the regular/old NFS client is now fstype "oldnfs".
  Although mounts via fstype "nfs" will usually work without userland
  changes, an updated mount_nfs(8) binary is needed for kernels built with
  "options NFSCL" but not "options NFSCLIENT". Updated mount_nfs(8) and
  mount(8) binaries are needed to do mounts for fstype "oldnfs".
  The GENERIC kernel configs have been changed to use options
  NFSCL and NFSD (the new client and server) instead of NFSCLIENT and NFSSERVER.
  For kernels being used on diskless NFS root systems, "options NFSCL"
  must be in the kernel config.
  Discussed on freebsd-fs@.

Modified:
  head/UPDATING
  head/sbin/mount/mount.c
  head/sbin/mount_nfs/Makefile
  head/sbin/mount_nfs/mount_nfs.c
  head/sys/amd64/conf/GENERIC
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/i386/conf/GENERIC
  head/sys/ia64/conf/GENERIC
  head/sys/nfsclient/nfs_vfsops.c
  head/sys/pc98/conf/GENERIC
  head/sys/powerpc/conf/GENERIC
  head/sys/powerpc/conf/GENERIC64
  head/sys/sparc64/conf/GENERIC
  head/sys/sun4v/conf/GENERIC

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/UPDATING	Wed Apr 27 17:51:51 2011	(r221124)
@@ -22,6 +22,24 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20110427:
+	The default NFS client is now the new NFS client, so fstype "newnfs"
+	is now "nfs" and the regular/old NFS client is now fstype "oldnfs".
+	Although mounts via fstype "nfs" will usually work without userland
+	changes, it is recommended that the mount(8) and mount_nfs(8)
+	commands be rebuilt from sources and that a link to mount_nfs called
+	mount_oldnfs be created. The new client is compiled into the
+	kernel with "options NFSCL" and this is needed for diskless root
+	file systems. The GENERIC kernel configs have been changed to use
+	NFSCL and NFSD (the new server) instead of NFSCLIENT and NFSSERVER.
+	To use the regular/old client, you can "mount -t oldnfs ...". For
+	a diskless root file system, you must also include a line like:
+	
+	vfs.root.mountfrom="oldnfs:"
+
+	in the boot/loader.conf on the root fs on the NFS server to make
+	a diskless root fs use the old client.
+
 20110424:
 	The GENERIC kernels for all architectures now default to the new
 	CAM-based ATA stack. It means that all legacy ATA drivers were

Modified: head/sbin/mount/mount.c
==============================================================================
--- head/sbin/mount/mount.c	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sbin/mount/mount.c	Wed Apr 27 17:51:51 2011	(r221124)
@@ -141,8 +141,8 @@ use_mountprog(const char *vfstype)
 	 */
 	unsigned int i;
 	const char *fs[] = {
-	"cd9660", "mfs", "msdosfs", "newnfs", "nfs", "ntfs",
-	"nwfs", "nullfs", "portalfs", "smbfs", "udf", "unionfs",
+	"cd9660", "mfs", "msdosfs", "nfs", "ntfs",
+	"nwfs", "nullfs", "oldnfs", "portalfs", "smbfs", "udf", "unionfs",
 	NULL
 	};
 

Modified: head/sbin/mount_nfs/Makefile
==============================================================================
--- head/sbin/mount_nfs/Makefile	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sbin/mount_nfs/Makefile	Wed Apr 27 17:51:51 2011	(r221124)
@@ -12,7 +12,7 @@ UMNTALL= ${.CURDIR}/../../usr.sbin/rpc.u
 CFLAGS+= -DNFS -I${MOUNT} -I${UMNTALL}
 WARNS?=	3
 
-LINKS=	${BINDIR}/mount_nfs ${BINDIR}/mount_newnfs
+LINKS=	${BINDIR}/mount_nfs ${BINDIR}/mount_oldnfs
 
 .PATH: ${MOUNT} ${UMNTALL}
 

Modified: head/sbin/mount_nfs/mount_nfs.c
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.c	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sbin/mount_nfs/mount_nfs.c	Wed Apr 27 17:51:51 2011	(r221124)
@@ -273,7 +273,7 @@ main(int argc, char *argv[])
 				} else if (strcmp(opt, "nfsv4") == 0) {
 					pass_flag_to_nmount=0;
 					mountmode = V4;
-					fstype = "newnfs";
+					fstype = "nfs";
 					nfsproto = IPPROTO_TCP;
 					if (portspec == NULL)
 						portspec = "2049";
@@ -381,14 +381,10 @@ main(int argc, char *argv[])
 		retrycnt = 0;
 
 	/*
-	 * If the experimental nfs subsystem is loaded into the kernel
-	 * and the regular one is not, use it. Otherwise, use it if the
-	 * fstype is set to "newnfs", either via "mount -t newnfs ..."
-	 * or by specifying an nfsv4 mount.
+	 * If the fstye is "oldnfs", run the old NFS client unless the
+	 * "nfsv4" option was specified.
 	 */
-	if (modfind("nfscl") >= 0 && modfind("nfs") < 0) {
-		fstype = "newnfs";
-	} else if (strcmp(fstype, "newnfs") == 0) {
+	if (strcmp(fstype, "nfs") == 0) {
 		if (modfind("nfscl") < 0) {
 			/* Not present in kernel, try loading it */
 			if (kldload("nfscl") < 0 ||

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/amd64/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -34,8 +34,8 @@ options 	UFS_ACL			# Support for access 
 options 	UFS_DIRHASH		# Improve performance on big directories
 options 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
 options 	MD_ROOT			# MD is a potential root device
-options 	NFSCLIENT		# Network Filesystem Client
-options 	NFSSERVER		# Network Filesystem Server
+options 	NFSCL			# New Network Filesystem Client
+options 	NFSD			# New Network Filesystem Server
 options 	NFSLOCKD		# Network Lock Manager
 options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT
 options 	MSDOSFS			# MSDOS Filesystem

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Wed Apr 27 17:51:51 2011	(r221124)
@@ -131,7 +131,7 @@ static struct vfsops nfs_vfsops = {
 	.vfs_unmount =		nfs_unmount,
 	.vfs_sysctl =		nfs_sysctl,
 };
-VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK);
+VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK);
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(newnfs, 1);

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/i386/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -36,8 +36,8 @@ options 	UFS_ACL			# Support for access 
 options 	UFS_DIRHASH		# Improve performance on big directories
 options 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
 options 	MD_ROOT			# MD is a potential root device
-options 	NFSCLIENT		# Network Filesystem Client
-options 	NFSSERVER		# Network Filesystem Server
+options 	NFSCL			# New Network Filesystem Client
+options 	NFSD			# New Network Filesystem Server
 options 	NFSLOCKD		# Network Lock Manager
 options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT
 options 	MSDOSFS			# MSDOS Filesystem

Modified: head/sys/ia64/conf/GENERIC
==============================================================================
--- head/sys/ia64/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/ia64/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -43,9 +43,9 @@ options 	KTRACE		# ktrace(1) syscall tra
 options 	MAC		# TrustedBSD MAC Framework
 options 	MD_ROOT		# MD usable as root device
 options 	MSDOSFS		# MSDOS Filesystem
-options 	NFSCLIENT	# Network Filesystem Client
+options 	NFSCL		# New Network Filesystem Client
 options 	NFSLOCKD	# Network Lock Manager
-options 	NFSSERVER	# Network Filesystem Server
+options 	NFSD		# New Network Filesystem Server
 options 	NFS_ROOT	# NFS usable as root device
 options 	P1003_1B_SEMAPHORES	# POSIX-style semaphores
 options 	PREEMPTION	# Enable kernel thread preemption

Modified: head/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- head/sys/nfsclient/nfs_vfsops.c	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/nfsclient/nfs_vfsops.c	Wed Apr 27 17:51:51 2011	(r221124)
@@ -144,7 +144,7 @@ static struct vfsops nfs_vfsops = {
 	.vfs_unmount =		nfs_unmount,
 	.vfs_sysctl =		nfs_sysctl,
 };
-VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK);
+VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK);
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(nfs, 1);

Modified: head/sys/pc98/conf/GENERIC
==============================================================================
--- head/sys/pc98/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/pc98/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -36,8 +36,8 @@ options 	UFS_ACL			# Support for access 
 options 	UFS_DIRHASH		# Improve performance on big directories
 options 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
 options 	MD_ROOT			# MD is a potential root device
-options 	NFSCLIENT		# Network Filesystem Client
-options 	NFSSERVER		# Network Filesystem Server
+options 	NFSCL			# New Network Filesystem Client
+options 	NFSD			# New Network Filesystem Server
 options 	NFSLOCKD		# Network Lock Manager
 options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT
 options 	MSDOSFS			# MSDOS Filesystem

Modified: head/sys/powerpc/conf/GENERIC
==============================================================================
--- head/sys/powerpc/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/powerpc/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -40,8 +40,8 @@ options 	UFS_ACL			#Support for access c
 options 	UFS_DIRHASH		#Improve performance on big directories
 options 	UFS_GJOURNAL		#Enable gjournal-based UFS journaling
 options 	MD_ROOT			#MD is a potential root device
-options 	NFSCLIENT		#Network Filesystem Client
-options 	NFSSERVER		#Network Filesystem Server
+options 	NFSCL			#New Network Filesystem Client
+options 	NFSD			#New Network Filesystem Server
 options 	NFSLOCKD		#Network Lock Manager
 options 	NFS_ROOT		#NFS usable as root device
 options 	MSDOSFS			#MSDOS Filesystem

Modified: head/sys/powerpc/conf/GENERIC64
==============================================================================
--- head/sys/powerpc/conf/GENERIC64	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/powerpc/conf/GENERIC64	Wed Apr 27 17:51:51 2011	(r221124)
@@ -40,8 +40,8 @@ options 	UFS_ACL			#Support for access c
 options 	UFS_DIRHASH		#Improve performance on big directories
 options 	UFS_GJOURNAL		#Enable gjournal-based UFS journaling
 options 	MD_ROOT			#MD is a potential root device
-options 	NFSCLIENT		#Network Filesystem Client
-options 	NFSSERVER		#Network Filesystem Server
+options 	NFSCL			#New Network Filesystem Client
+options 	NFSD			#New Network Filesystem Server
 options 	NFSLOCKD		#Network Lock Manager
 options 	NFS_ROOT		#NFS usable as root device
 options 	MSDOSFS			#MSDOS Filesystem

Modified: head/sys/sparc64/conf/GENERIC
==============================================================================
--- head/sys/sparc64/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/sparc64/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -37,8 +37,8 @@ options 	UFS_ACL			# Support for access 
 options 	UFS_DIRHASH		# Improve performance on big directories
 options 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
 options 	MD_ROOT			# MD is a potential root device
-options 	NFSCLIENT		# Network Filesystem Client
-options 	NFSSERVER		# Network Filesystem Server
+options 	NFSCL			# New Network Filesystem Client
+options 	NFSD			# New Network Filesystem Server
 options 	NFSLOCKD		# Network Lock Manager
 options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT
 #options 	MSDOSFS			# MSDOS Filesystem

Modified: head/sys/sun4v/conf/GENERIC
==============================================================================
--- head/sys/sun4v/conf/GENERIC	Wed Apr 27 17:36:37 2011	(r221123)
+++ head/sys/sun4v/conf/GENERIC	Wed Apr 27 17:51:51 2011	(r221124)
@@ -40,8 +40,8 @@ options 	UFS_ACL			# Support for access 
 options 	UFS_DIRHASH		# Improve performance on big directories
 options 	UFS_GJOURNAL		# Enable gjournal-based UFS journaling
 options 	MD_ROOT			# MD is a potential root device
-options 	NFSCLIENT		# Network Filesystem Client
-options 	NFSSERVER		# Network Filesystem Server
+options 	NFSCL			# New Network Filesystem Client
+options 	NFSD			# New Network Filesystem Server
 options 	NFSLOCKD		# Network Lock Manager
 options 	NFS_ROOT		# NFS usable as /, requires NFSCLIENT
 #options 	MSDOSFS			# MSDOS Filesystem

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 18:15:35 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3878C1065673;
	Wed, 27 Apr 2011 18:15:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A66D8FC14;
	Wed, 27 Apr 2011 18:15:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RIFZiV082941;
	Wed, 27 Apr 2011 18:15:35 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RIFZfi082935;
	Wed, 27 Apr 2011 18:15:35 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104271815.p3RIFZfi082935@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 27 Apr 2011 18:15:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221126 - head/sys/fs/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 18:15:35 -0000

Author: jhb
Date: Wed Apr 27 18:15:34 2011
New Revision: 221126
URL: http://svn.freebsd.org/changeset/base/221126

Log:
  Various style fixes including using uint*_t instead of u_int*_t.
  
  Submitted by:	Pedro F. Giffuni  giffunip at yahoo

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c
  head/sys/fs/ext2fs/ext2_dinode.h
  head/sys/fs/ext2fs/ext2_dir.h
  head/sys/fs/ext2fs/ext2fs.h
  head/sys/fs/ext2fs/inode.h

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_alloc.c	Wed Apr 27 18:00:46 2011	(r221125)
+++ head/sys/fs/ext2fs/ext2_alloc.c	Wed Apr 27 18:15:34 2011	(r221126)
@@ -181,7 +181,7 @@ return ENOSPC;
 	struct ext2mount *ump;
 	struct cluster_save *buflist;
 	struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
-	int32_t start_lbn, end_lbn, soff, newblk, blkno =0;
+	int32_t start_lbn, end_lbn, soff, newblk, blkno;
 	int i, len, start_lvl, end_lvl, pref, ssize;
 
 	vp = ap->a_vp;
@@ -231,7 +231,7 @@ return ENOSPC;
 	 * Find the preferred location for the cluster.
 	 */
 	EXT2_LOCK(ump);
-	pref = ext2_blkpref(ip, start_lbn, soff, sbap, blkno);
+	pref = ext2_blkpref(ip, start_lbn, soff, sbap, 0);
 	/*
 	 * If the block range spans two block maps, get the second map.
 	 */

Modified: head/sys/fs/ext2fs/ext2_dinode.h
==============================================================================
--- head/sys/fs/ext2fs/ext2_dinode.h	Wed Apr 27 18:00:46 2011	(r221125)
+++ head/sys/fs/ext2fs/ext2_dinode.h	Wed Apr 27 18:15:34 2011	(r221126)
@@ -66,29 +66,29 @@
  * Structure of an inode on the disk
  */
 struct ext2fs_dinode {
-	u_int16_t	e2di_mode;	/*   0: IFMT, permissions; see below. */
-	u_int16_t	e2di_uid;	/*   2: Owner UID */
-	u_int32_t	e2di_size;	/*	 4: Size (in bytes) */
-	u_int32_t	e2di_atime;	/*	 8: Access time */
-	u_int32_t	e2di_ctime;	/*	12: Create time */
-	u_int32_t	e2di_mtime;	/*	16: Modification time */
-	u_int32_t	e2di_dtime;	/*	20: Deletion time */
-	u_int16_t	e2di_gid;	/*  24: Owner GID */
-	u_int16_t	e2di_nlink;	/*  26: File link count */
-	u_int32_t	e2di_nblock;	/*  28: Blocks count */
-	u_int32_t	e2di_flags;	/*  32: Status flags (chflags) */
-	u_int32_t	e2di_linux_reserved1; /* 36 */
-	u_int32_t	e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */
-	u_int32_t	e2di_gen;	/* 100: generation number */
-	u_int32_t	e2di_facl;	/* 104: file ACL (not implemented) */
-	u_int32_t	e2di_dacl;	/* 108: dir ACL (not implemented) */
-	u_int32_t	e2di_faddr;	/* 112: fragment address */
-	u_int8_t	e2di_nfrag;	/* 116: fragment number */
-	u_int8_t	e2di_fsize;	/* 117: fragment size */
-	u_int16_t	e2di_linux_reserved2; /* 118 */
-	u_int16_t	e2di_uid_high;	/* 120: Owner UID top 16 bits */
-	u_int16_t	e2di_gid_high;	/* 122: Owner GID top 16 bits */
-	u_int32_t	e2di_linux_reserved3; /* 124 */
+	uint16_t	e2di_mode;	/*   0: IFMT, permissions; see below. */
+	uint16_t	e2di_uid;	/*   2: Owner UID */
+	uint32_t	e2di_size;	/*	 4: Size (in bytes) */
+	uint32_t	e2di_atime;	/*	 8: Access time */
+	uint32_t	e2di_ctime;	/*	12: Create time */
+	uint32_t	e2di_mtime;	/*	16: Modification time */
+	uint32_t	e2di_dtime;	/*	20: Deletion time */
+	uint16_t	e2di_gid;	/*  24: Owner GID */
+	uint16_t	e2di_nlink;	/*  26: File link count */
+	uint32_t	e2di_nblock;	/*  28: Blocks count */
+	uint32_t	e2di_flags;	/*  32: Status flags (chflags) */
+	uint32_t	e2di_linux_reserved1; /* 36 */
+	uint32_t	e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */
+	uint32_t	e2di_gen;	/* 100: generation number */
+	uint32_t	e2di_facl;	/* 104: file ACL (not implemented) */
+	uint32_t	e2di_dacl;	/* 108: dir ACL (not implemented) */
+	uint32_t	e2di_faddr;	/* 112: fragment address */
+	uint8_t		e2di_nfrag;	/* 116: fragment number */
+	uint8_t		e2di_fsize;	/* 117: fragment size */
+	uint16_t	e2di_linux_reserved2; /* 118 */
+	uint16_t	e2di_uid_high;	/* 120: Owner UID top 16 bits */
+	uint16_t	e2di_gid_high;	/* 122: Owner GID top 16 bits */
+	uint32_t	e2di_linux_reserved3; /* 124 */
 };
 
 #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */

Modified: head/sys/fs/ext2fs/ext2_dir.h
==============================================================================
--- head/sys/fs/ext2fs/ext2_dir.h	Wed Apr 27 18:00:46 2011	(r221125)
+++ head/sys/fs/ext2fs/ext2_dir.h	Wed Apr 27 18:15:34 2011	(r221126)
@@ -35,9 +35,9 @@
 #define EXT2FS_MAXNAMLEN 255
 
 struct	ext2fs_direct {
-	u_int32_t e2d_ino;		/* inode number of entry */
-	u_int16_t e2d_reclen;		/* length of this record */
-	u_int16_t e2d_namlen;		/* length of string in d_name */
+	uint32_t e2d_ino;		/* inode number of entry */
+	uint16_t e2d_reclen;		/* length of this record */
+	uint16_t e2d_namlen;		/* length of string in d_name */
 	char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
 /*
@@ -47,10 +47,10 @@ struct	ext2fs_direct {
  * file_type field.
  */
 struct	ext2fs_direct_2 {
-	u_int32_t e2d_ino;		/* inode number of entry */
-	u_int16_t e2d_reclen;		/* length of this record */
-	u_int8_t e2d_namlen;		/* length of string in d_name */
-	u_int8_t e2d_type;		/* file type */
+	uint32_t e2d_ino;		/* inode number of entry */
+	uint16_t e2d_reclen;		/* length of this record */
+	uint8_t e2d_namlen;		/* length of string in d_name */
+	uint8_t e2d_type;		/* file type */
 	char e2d_name[EXT2FS_MAXNAMLEN];/* name with length<=EXT2FS_MAXNAMLEN */
 };
 /*

Modified: head/sys/fs/ext2fs/ext2fs.h
==============================================================================
--- head/sys/fs/ext2fs/ext2fs.h	Wed Apr 27 18:00:46 2011	(r221125)
+++ head/sys/fs/ext2fs/ext2fs.h	Wed Apr 27 18:15:34 2011	(r221126)
@@ -65,44 +65,55 @@
  * Super block for an ext2fs file system.
  */
 struct ext2fs {
-	u_int32_t  e2fs_icount;		/* Inode count */
-	u_int32_t  e2fs_bcount;		/* blocks count */
-	u_int32_t  e2fs_rbcount;	/* reserved blocks count */
-	u_int32_t  e2fs_fbcount;	/* free blocks count */
-	u_int32_t  e2fs_ficount;	/* free inodes count */
-	u_int32_t  e2fs_first_dblock;	/* first data block */
-	u_int32_t  e2fs_log_bsize;	/* block size = 1024*(2^e2fs_log_bsize) */
-	u_int32_t  e2fs_log_fsize;	/* fragment size */
-	u_int32_t  e2fs_bpg;		/* blocks per group */
-	u_int32_t  e2fs_fpg;		/* frags per group */
-	u_int32_t  e2fs_ipg;		/* inodes per group */
-	u_int32_t  e2fs_mtime;		/* mount time */
-	u_int32_t  e2fs_wtime;		/* write time */
-	u_int16_t  e2fs_mnt_count;	/* mount count */
-	u_int16_t  e2fs_max_mnt_count;	/* max mount count */
-	u_int16_t  e2fs_magic;		/* magic number */
-	u_int16_t  e2fs_state;		/* file system state */
-	u_int16_t  e2fs_beh;		/* behavior on errors */
-	u_int16_t  e2fs_minrev;		/* minor revision level */
-	u_int32_t  e2fs_lastfsck;	/* time of last fsck */
-	u_int32_t  e2fs_fsckintv;	/* max time between fscks */
-	u_int32_t  e2fs_creator;	/* creator OS */
-	u_int32_t  e2fs_rev;		/* revision level */
-	u_int16_t  e2fs_ruid;		/* default uid for reserved blocks */
-	u_int16_t  e2fs_rgid;		/* default gid for reserved blocks */
+	uint32_t  e2fs_icount;		/* Inode count */
+	uint32_t  e2fs_bcount;		/* blocks count */
+	uint32_t  e2fs_rbcount;		/* reserved blocks count */
+	uint32_t  e2fs_fbcount;		/* free blocks count */
+	uint32_t  e2fs_ficount;		/* free inodes count */
+	uint32_t  e2fs_first_dblock;	/* first data block */
+	uint32_t  e2fs_log_bsize;	/* block size = 1024*(2^e2fs_log_bsize) */
+	uint32_t  e2fs_log_fsize;	/* fragment size */
+	uint32_t  e2fs_bpg;		/* blocks per group */
+	uint32_t  e2fs_fpg;		/* frags per group */
+	uint32_t  e2fs_ipg;		/* inodes per group */
+	uint32_t  e2fs_mtime;		/* mount time */
+	uint32_t  e2fs_wtime;		/* write time */
+	uint16_t  e2fs_mnt_count;	/* mount count */
+	uint16_t  e2fs_max_mnt_count;	/* max mount count */
+	uint16_t  e2fs_magic;		/* magic number */
+	uint16_t  e2fs_state;		/* file system state */
+	uint16_t  e2fs_beh;		/* behavior on errors */
+	uint16_t  e2fs_minrev;		/* minor revision level */
+	uint32_t  e2fs_lastfsck;	/* time of last fsck */
+	uint32_t  e2fs_fsckintv;	/* max time between fscks */
+	uint32_t  e2fs_creator;		/* creator OS */
+	uint32_t  e2fs_rev;		/* revision level */
+	uint16_t  e2fs_ruid;		/* default uid for reserved blocks */
+	uint16_t  e2fs_rgid;		/* default gid for reserved blocks */
 	/* EXT2_DYNAMIC_REV superblocks */
-	u_int32_t  e2fs_first_ino;	/* first non-reserved inode */
-	u_int16_t  e2fs_inode_size;	/* size of inode structure */
-	u_int16_t  e2fs_block_group_nr;	/* block grp number of this sblk*/
-	u_int32_t  e2fs_features_compat; /*  compatible feature set */
-	u_int32_t  e2fs_features_incompat; /* incompatible feature set */
-	u_int32_t  e2fs_features_rocompat; /* RO-compatible feature set */
-	u_int8_t   e2fs_uuid[16];	/* 128-bit uuid for volume */
-	char       e2fs_vname[16];	/* volume name */
-	char       e2fs_fsmnt[64]; 	/* name mounted on */
-	u_int32_t  e2fs_algo;		/* For comcate for dir */
-	u_int16_t  e2fs_reserved_ngdb; /* # of reserved gd blocks for resize */
-	u_int32_t  reserved2[204];
+	uint32_t  e2fs_first_ino;	/* first non-reserved inode */
+	uint16_t  e2fs_inode_size;	/* size of inode structure */
+	uint16_t  e2fs_block_group_nr;	/* block grp number of this sblk*/
+	uint32_t  e2fs_features_compat; /*  compatible feature set */
+	uint32_t  e2fs_features_incompat; /* incompatible feature set */
+	uint32_t  e2fs_features_rocompat; /* RO-compatible feature set */
+	uint8_t	  e2fs_uuid[16];	/* 128-bit uuid for volume */
+	char      e2fs_vname[16];	/* volume name */
+	char      e2fs_fsmnt[64]; 	/* name mounted on */
+	uint32_t  e2fs_algo;		/* For compression */
+	uint8_t   e2fs_prealloc;	/* # of blocks for old prealloc */
+	uint8_t   e2fs_dir_prealloc;	/* # of blocks for old prealloc dirs */
+	uint16_t  e2fs_reserved_ngdb;	/* # of reserved gd blocks for resize */
+	char      e3fs_journal_uuid[16]; /* uuid of journal superblock */
+	uint32_t  e3fs_journal_inum;	/* inode number of journal file */
+	uint32_t  e3fs_journal_dev;	/* device number of journal file */
+	uint32_t  e3fs_last_orphan;	/* start of list of inodes to delete */
+	uint32_t  e3fs_hash_seed[4];	/* HTREE hash seed */
+	char      e3fs_def_hash_version; /* Default hash version to use */
+	char      e3fs_reserved_char_pad;
+	uint32_t  e3fs_default_mount_opts;
+	uint32_t  e3fs_first_meta_bg;	/* First metablock block group */
+	uint32_t  reserved2[190];	/* Padding to the end of the block */
 };
 
 
@@ -112,14 +123,14 @@ struct ext2fs {
 
 struct m_ext2fs {
 	struct ext2fs * e2fs;
-	char e2fs_fsmnt[MAXMNTLEN];/* name mounted on */
-	char e2fs_ronly;          /* mounted read-only flag */
-	char e2fs_fmod;           /* super block modified flag */
+	char     e2fs_fsmnt[MAXMNTLEN];/* name mounted on */
+	char     e2fs_ronly;      /* mounted read-only flag */
+	char     e2fs_fmod;       /* super block modified flag */
 	uint32_t e2fs_bsize;      /* Block size */
 	uint32_t e2fs_bshift;     /* calc of logical block no */
-	int32_t e2fs_bmask;       /* calc of block offset */
-	int32_t e2fs_bpg;         /* Number of blocks per group */
-	int64_t e2fs_qbmask;      /* = s_blocksize -1 */
+	int32_t  e2fs_bmask;      /* calc of block offset */
+	int32_t  e2fs_bpg;        /* Number of blocks per group */
+	int64_t  e2fs_qbmask;     /* = s_blocksize -1 */
 	uint32_t e2fs_fsbtodb;    /* Shift to get disk block */
 	uint32_t e2fs_ipg;        /* Number of inodes per group */
 	uint32_t e2fs_ipb;        /* Number of inodes per block */
@@ -137,9 +148,9 @@ struct m_ext2fs {
 	uint32_t e2fs_blocksize_bits;
 	uint32_t e2fs_total_dir;  /* Total number of directories */
 	uint8_t	*e2fs_contigdirs; /* (u) # of contig. allocated dirs */
-	char e2fs_wasvalid;       /* valid at mount time */
-	off_t e2fs_maxfilesize;
-	struct ext2_gd *e2fs_gd; /* Group Descriptors */
+	char     e2fs_wasvalid;   /* valid at mount time */
+	off_t    e2fs_maxfilesize;
+	struct   ext2_gd *e2fs_gd; /* Group Descriptors */
 };
 
 /*
@@ -232,14 +243,14 @@ struct m_ext2fs {
 /* ext2 file system block group descriptor */
 
 struct ext2_gd {
-	u_int32_t ext2bgd_b_bitmap;	/* blocks bitmap block */
-	u_int32_t ext2bgd_i_bitmap;	/* inodes bitmap block */
-	u_int32_t ext2bgd_i_tables;	/* inodes table block  */
-	u_int16_t ext2bgd_nbfree;	/* number of free blocks */
-	u_int16_t ext2bgd_nifree;	/* number of free inodes */
-	u_int16_t ext2bgd_ndirs;	/* number of directories */
-	u_int16_t reserved;
-	u_int32_t reserved2[3];
+	uint32_t ext2bgd_b_bitmap;	/* blocks bitmap block */
+	uint32_t ext2bgd_i_bitmap;	/* inodes bitmap block */
+	uint32_t ext2bgd_i_tables;	/* inodes table block  */
+	uint16_t ext2bgd_nbfree;	/* number of free blocks */
+	uint16_t ext2bgd_nifree;	/* number of free inodes */
+	uint16_t ext2bgd_ndirs;	/* number of directories */
+	uint16_t reserved;
+	uint32_t reserved2[3];
 };
 
 /* EXT2FS metadatas are stored in little-endian byte order. These macros

Modified: head/sys/fs/ext2fs/inode.h
==============================================================================
--- head/sys/fs/ext2fs/inode.h	Wed Apr 27 18:00:46 2011	(r221125)
+++ head/sys/fs/ext2fs/inode.h	Wed Apr 27 18:15:34 2011	(r221126)
@@ -63,7 +63,7 @@
 struct inode {
 	struct	vnode  *i_vnode;/* Vnode associated with this inode. */
 	struct	ext2mount *i_ump;
-	u_int32_t i_flag;	/* flags, see below */
+	uint32_t i_flag;	/* flags, see below */
 	ino_t	  i_number;	/* The identity of the inode. */
 
 	struct	m_ext2fs *i_e2fs;	/* EXT2FS */
@@ -71,21 +71,21 @@ struct inode {
 	/*
 	 * Side effects; used during directory lookup.
 	 */
-	int32_t	  i_count;	/* Size of free slot in directory. */
-	doff_t	  i_endoff;	/* End of useful stuff in directory. */
-	doff_t	  i_diroff;	/* Offset in dir, where we found last entry. */
-	doff_t	  i_offset;	/* Offset of free space in directory. */
-
-	u_int32_t i_block_group;
-	u_int32_t i_next_alloc_block;
-	u_int32_t i_next_alloc_goal;
-	u_int32_t i_prealloc_block;
-	u_int32_t i_prealloc_count;
+	int32_t	 i_count;	/* Size of free slot in directory. */
+	doff_t	 i_endoff;	/* End of useful stuff in directory. */
+	doff_t	 i_diroff;	/* Offset in dir, where we found last entry. */
+	doff_t	 i_offset;	/* Offset of free space in directory. */
+
+	uint32_t i_block_group;
+	uint32_t i_next_alloc_block;
+	uint32_t i_next_alloc_goal;
+	uint32_t i_prealloc_block;
+	uint32_t i_prealloc_count;
 
 	/* Fields from struct dinode in UFS. */
-	u_int16_t	i_mode;		/* IFMT, permissions; see below. */
+	uint16_t	i_mode;		/* IFMT, permissions; see below. */
 	int16_t		i_nlink;	/* File link count. */
-	u_int64_t	i_size;		/* File byte count. */
+	uint64_t	i_size;		/* File byte count. */
 	int32_t		i_atime;	/* Last access time. */
 	int32_t		i_atimensec;	/* Last access time. */
 	int32_t		i_mtime;	/* Last modified time. */
@@ -94,11 +94,11 @@ struct inode {
 	int32_t		i_ctimensec;	/* Last inode change time. */
 	int32_t		i_db[NDADDR];	/* Direct disk blocks. */
 	int32_t		i_ib[NIADDR];	/* Indirect disk blocks. */
-	u_int32_t	i_flags;	/* Status flags (chflags). */
+	uint32_t	i_flags;	/* Status flags (chflags). */
 	int32_t		i_blocks;	/* Blocks actually held. */
 	int32_t		i_gen;		/* Generation number. */
-	u_int32_t	i_uid;		/* File owner. */
-	u_int32_t	i_gid;		/* File group. */
+	uint32_t	i_uid;		/* File owner. */
+	uint32_t	i_gid;		/* File group. */
 };
 
 /*
@@ -162,10 +162,10 @@ struct indir {
 
 /* This overlays the fid structure (see mount.h). */
 struct ufid {
-	u_int16_t ufid_len;	/* Length of structure. */
-	u_int16_t ufid_pad;	/* Force 32-bit alignment. */
-	ino_t	  ufid_ino;	/* File number (ino). */
-	int32_t	  ufid_gen;	/* Generation number. */
+	uint16_t ufid_len;	/* Length of structure. */
+	uint16_t ufid_pad;	/* Force 32-bit alignment. */
+	ino_t	 ufid_ino;	/* File number (ino). */
+	int32_t	 ufid_gen;	/* Generation number. */
 };
 #endif /* _KERNEL */
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 18:19:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D4B98106566C;
	Wed, 27 Apr 2011 18:19:26 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BB4898FC12;
	Wed, 27 Apr 2011 18:19:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RIJQk9083094;
	Wed, 27 Apr 2011 18:19:26 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RIJQDc083089;
	Wed, 27 Apr 2011 18:19:26 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104271819.p3RIJQDc083089@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 27 Apr 2011 18:19:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221127 - head/sys/rpc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 18:19:27 -0000

Author: rmacklem
Date: Wed Apr 27 18:19:26 2011
New Revision: 221127
URL: http://svn.freebsd.org/changeset/base/221127

Log:
  This patch is believed to fix a problem in the kernel rpc for
  non-interruptible NFS mounts, where a kernel thread will seem
  to be stuck sleeping on "rpccon". The msleep() in clnt_vc_create()
  that was waiting to a TCP connect to complete would return ERESTART,
  since PCATCH was specified. Then the tsleep() in clnt_reconnect_call()
  would sleep for 1 second and then try again and again and...
  The patch changes the msleep() in clnt_vc_create() so it only sets
  the PCATCH flag for interruptible cases.
  
  Tested by:	pho
  Reviewed by:	jhb
  MFC after:	2 weeks

Modified:
  head/sys/rpc/clnt.h
  head/sys/rpc/clnt_rc.c
  head/sys/rpc/clnt_vc.c
  head/sys/rpc/rpcb_clnt.c

Modified: head/sys/rpc/clnt.h
==============================================================================
--- head/sys/rpc/clnt.h	Wed Apr 27 18:15:34 2011	(r221126)
+++ head/sys/rpc/clnt.h	Wed Apr 27 18:19:26 2011	(r221127)
@@ -433,10 +433,11 @@ extern CLIENT *clnt_dg_create(struct soc
  *	rpcvers_t vers;				-- version number
  *	size_t sendsz;				-- buffer recv size
  *	size_t recvsz;				-- buffer send size
+ *	int intrflag;				-- is it interruptible
  */
 extern CLIENT *clnt_vc_create(struct socket *so,
     struct sockaddr *svcaddr, rpcprog_t program, rpcvers_t version,
-    size_t sendsz, size_t recvsz);
+    size_t sendsz, size_t recvsz, int intrflag);
 
 /*
  *	struct netconfig *nconf;		-- network type

Modified: head/sys/rpc/clnt_rc.c
==============================================================================
--- head/sys/rpc/clnt_rc.c	Wed Apr 27 18:15:34 2011	(r221126)
+++ head/sys/rpc/clnt_rc.c	Wed Apr 27 18:19:26 2011	(r221127)
@@ -195,7 +195,7 @@ clnt_reconnect_connect(CLIENT *cl)
 	else
 		newclient = clnt_vc_create(so,
 		    (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers,
-		    rc->rc_sendsz, rc->rc_recvsz);
+		    rc->rc_sendsz, rc->rc_recvsz, rc->rc_intr);
 	td->td_ucred = oldcred;
 
 	if (!newclient) {

Modified: head/sys/rpc/clnt_vc.c
==============================================================================
--- head/sys/rpc/clnt_vc.c	Wed Apr 27 18:15:34 2011	(r221126)
+++ head/sys/rpc/clnt_vc.c	Wed Apr 27 18:19:26 2011	(r221127)
@@ -168,7 +168,8 @@ clnt_vc_create(
 	const rpcprog_t prog,		/* program number */
 	const rpcvers_t vers,		/* version number */
 	size_t sendsz,			/* buffer recv size */
-	size_t recvsz)			/* buffer send size */
+	size_t recvsz,			/* buffer send size */
+	int intrflag)			/* interruptible */
 {
 	CLIENT *cl;			/* client handle */
 	struct ct_data *ct = NULL;	/* client handle */
@@ -177,7 +178,7 @@ clnt_vc_create(
 	static uint32_t disrupt;
 	struct __rpc_sockinfo si;
 	XDR xdrs;
-	int error, interrupted, one = 1;
+	int error, interrupted, one = 1, sleep_flag;
 	struct sockopt sopt;
 
 	if (disrupt == 0)
@@ -196,10 +197,13 @@ clnt_vc_create(
 		error = soconnect(so, raddr, curthread);
 		SOCK_LOCK(so);
 		interrupted = 0;
+		sleep_flag = PSOCK;
+		if (intrflag != 0)
+			sleep_flag |= (PCATCH | PBDRY);
 		while ((so->so_state & SS_ISCONNECTING)
 		    && so->so_error == 0) {
 			error = msleep(&so->so_timeo, SOCK_MTX(so),
-			    PSOCK | PCATCH | PBDRY, "connec", 0);
+			    sleep_flag, "connec", 0);
 			if (error) {
 				if (error == EINTR || error == ERESTART)
 					interrupted = 1;

Modified: head/sys/rpc/rpcb_clnt.c
==============================================================================
--- head/sys/rpc/rpcb_clnt.c	Wed Apr 27 18:15:34 2011	(r221126)
+++ head/sys/rpc/rpcb_clnt.c	Wed Apr 27 18:19:26 2011	(r221127)
@@ -477,7 +477,7 @@ local_rpcb()
 
 	tsize = __rpc_get_t_size(AF_LOCAL, 0, 0);
 	client = clnt_vc_create(so, (struct sockaddr *)&sun, (rpcprog_t)RPCBPROG,
-	    (rpcvers_t)RPCBVERS, tsize, tsize);
+	    (rpcvers_t)RPCBVERS, tsize, tsize, 1);
 
 	if (client != NULL) {
 		/* Mark the socket to be closed in destructor */

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 18:25:36 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CD57106564A;
	Wed, 27 Apr 2011 18:25:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F09A8FC14;
	Wed, 27 Apr 2011 18:25:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RIPanB083324;
	Wed, 27 Apr 2011 18:25:36 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RIPaup083319;
	Wed, 27 Apr 2011 18:25:36 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104271825.p3RIPaup083319@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 27 Apr 2011 18:25:36 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221128 - head/sys/fs/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 18:25:36 -0000

Author: jhb
Date: Wed Apr 27 18:25:35 2011
New Revision: 221128
URL: http://svn.freebsd.org/changeset/base/221128

Log:
  Use a private EXT2_ROOTINO constant instead of redefining ROOTINO.
  
  Submitted by:	Pedro F. Giffuni  giffunip at yahoo

Modified:
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_vfsops.c
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/fs/ext2fs/inode.h

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_lookup.c	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/ext2_lookup.c	Wed Apr 27 18:25:35 2011	(r221128)
@@ -57,9 +57,10 @@
 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
+#include 
 
 #ifdef DIAGNOSTIC
 static int dirchk = 1;
@@ -1056,7 +1057,7 @@ ext2_checkpath(source, target, cred)
 		error = EEXIST;
 		goto out;
 	}
-	rootino = ROOTINO;
+	rootino = EXT2_ROOTINO;
 	error = 0;
 	if (target->i_number == rootino)
 		goto out;

Modified: head/sys/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vfsops.c	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/ext2_vfsops.c	Wed Apr 27 18:25:35 2011	(r221128)
@@ -983,7 +983,7 @@ ext2_fhtovp(struct mount *mp, struct fid
 
 	ufhp = (struct ufid *)fhp;
 	fs = VFSTOEXT2(mp)->um_e2fs;
-	if (ufhp->ufid_ino < ROOTINO ||
+	if (ufhp->ufid_ino < EXT2_ROOTINO ||
 	    ufhp->ufid_ino > fs->e2fs_gcount * fs->e2fs->e2fs_ipg)
 		return (ESTALE);
 
@@ -1063,7 +1063,7 @@ ext2_root(struct mount *mp, int flags, s
 	struct vnode *nvp;
 	int error;
 
-	error = VFS_VGET(mp, (ino_t)ROOTINO, LK_EXCLUSIVE, &nvp);
+	error = VFS_VGET(mp, EXT2_ROOTINO, LK_EXCLUSIVE, &nvp);
 	if (error)
 		return (error);
 	*vpp = nvp;

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Wed Apr 27 18:25:35 2011	(r221128)
@@ -71,12 +71,13 @@
 
 #include 
 
-#include 
-#include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 static int ext2_makeinode(int mode, struct vnode *, struct vnode **, struct componentname *);
 static void ext2_itimes_locked(struct vnode *);
@@ -1581,7 +1582,7 @@ ext2_vinit(mntp, fifoops, vpp)
 	if (vp->v_type == VFIFO)
 		vp->v_op = fifoops;
 
-	if (ip->i_number == ROOTINO)
+	if (ip->i_number == EXT2_ROOTINO)
 		vp->v_vflag |= VV_ROOT;
 	ip->i_modrev = init_va_filerev();
 	*vpp = vp;

Modified: head/sys/fs/ext2fs/inode.h
==============================================================================
--- head/sys/fs/ext2fs/inode.h	Wed Apr 27 18:19:26 2011	(r221127)
+++ head/sys/fs/ext2fs/inode.h	Wed Apr 27 18:25:35 2011	(r221128)
@@ -41,8 +41,6 @@
 #include 
 #include 
 
-#define	ROOTINO	((ino_t)2)
-
 #define	NDADDR	12			/* Direct addresses in inode. */
 #define	NIADDR	3			/* Indirect addresses in inode. */
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:01:07 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C477106564A;
	Wed, 27 Apr 2011 19:01:07 +0000 (UTC)
	(envelope-from bzeeb-lists@lists.zabbadoz.net)
Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25])
	by mx1.freebsd.org (Postfix) with ESMTP id DE77F8FC0C;
	Wed, 27 Apr 2011 19:01:06 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id 81BB525D3860;
	Wed, 27 Apr 2011 19:01:04 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id DAA06159DDF8;
	Wed, 27 Apr 2011 19:01:03 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id L6CgrGOWx1zi; Wed, 27 Apr 2011 19:01:03 +0000 (UTC)
Received: from orange-en1.sbone.de (orange-en1.sbone.de
	[IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id CB911159DDDD;
	Wed, 27 Apr 2011 19:01:02 +0000 (UTC)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: "Bjoern A. Zeeb" 
In-Reply-To: <201104271751.p3RHpp6H081910@svn.freebsd.org>
Date: Wed, 27 Apr 2011 19:01:01 +0000
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <201104271751.p3RHpp6H081910@svn.freebsd.org>
To: Rick Macklem 
X-Mailer: Apple Mail (2.1084)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221124 - in head: . sbin/mount sbin/mount_nfs
	sys/amd64/conf sys/fs/nfsclient sys/i386/conf sys/ia64/conf
	sys/nfsclient sys/pc98/conf sys/powerpc/conf sys/sparc64/conf
	sys/sun4v/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:01:07 -0000

On Apr 27, 2011, at 5:51 PM, Rick Macklem wrote:

> Author: rmacklem
> Date: Wed Apr 27 17:51:51 2011
> New Revision: 221124
> URL: http://svn.freebsd.org/changeset/base/221124
> 
> Log:
>  This patch changes head so that the default NFS client is now the new
>  NFS client (which I guess is no longer experimental). The fstype "newnfs"
>  is now "nfs" and the regular/old NFS client is now fstype "oldnfs".

Wooohooo!  Thanks a lot for all the hard work! :)

Bjoern

-- 
Bjoern A. Zeeb                                 You have to have visions!
         Stop bit received. Insert coin for new address family.


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:28:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 543B7106567A;
	Wed, 27 Apr 2011 19:28:43 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 441AF8FC16;
	Wed, 27 Apr 2011 19:28:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RJShF3085722;
	Wed, 27 Apr 2011 19:28:43 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RJShEB085713;
	Wed, 27 Apr 2011 19:28:43 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104271928.p3RJShEB085713@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 27 Apr 2011 19:28:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221129 - in head/sys: netinet6 netipsec
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:28:43 -0000

Author: bz
Date: Wed Apr 27 19:28:42 2011
New Revision: 221129
URL: http://svn.freebsd.org/changeset/base/221129

Log:
  Make IPsec compile without INET adding appropriate #ifdef checks.
  
  Unfold the IPSEC_COMMON_INPUT_CB() macro in xform_{ah,esp,ipcomp}.c
  to not need three different versions depending on INET, INET6 or both.
  
  Mark two places preparing for not yet supported functionality with IPv6.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/netinet6/ip6_ipsec.c
  head/sys/netipsec/ipsec_input.c
  head/sys/netipsec/ipsec_output.c
  head/sys/netipsec/key.c
  head/sys/netipsec/xform_ah.c
  head/sys/netipsec/xform_esp.c
  head/sys/netipsec/xform_ipcomp.c
  head/sys/netipsec/xform_ipip.c

Modified: head/sys/netinet6/ip6_ipsec.c
==============================================================================
--- head/sys/netinet6/ip6_ipsec.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netinet6/ip6_ipsec.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -30,6 +30,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
 
@@ -43,6 +44,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -291,7 +293,11 @@ ip6_ipsec_output(struct mbuf **m, struct
 		 * this is done in the normal processing path.
 		 */
 		if ((*m)->m_pkthdr.csum_flags & CSUM_DELAY_DATA) {
+			ipseclog((LOG_DEBUG,
+			    "%s: we do not support IPv4 over IPv6", __func__));
+#ifdef INET
 			in_delayed_cksum(*m);
+#endif
 			(*m)->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA;
 		}
 

Modified: head/sys/netipsec/ipsec_input.c
==============================================================================
--- head/sys/netipsec/ipsec_input.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/ipsec_input.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -119,9 +119,11 @@ ipsec_common_input(struct mbuf *m, int s
 	struct secasvar *sav;
 	u_int32_t spi;
 	int error;
+#ifdef INET
 #ifdef IPSEC_NAT_T
 	struct m_tag *tag;
 #endif
+#endif
 
 	IPSEC_ISTAT(sproto, V_espstat.esps_input, V_ahstat.ahs_input,
 		V_ipcompstat.ipcomps_input);

Modified: head/sys/netipsec/ipsec_output.c
==============================================================================
--- head/sys/netipsec/ipsec_output.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/ipsec_output.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -165,7 +165,29 @@ ipsec_process_done(struct mbuf *m, struc
 	 */
 	if (isr->next) {
 		V_ipsec4stat.ips_out_bundlesa++;
-		return ipsec4_process_packet(m, isr->next, 0, 0);
+		sav = isr->next->sav;
+		saidx = &sav->sah->saidx;
+		switch (saidx->dst.sa.sa_family) {
+#ifdef INET
+		case AF_INET:
+			return ipsec4_process_packet(m, isr->next, 0, 0);
+			/* NOTREACHED */
+#endif
+#ifdef notyet
+#ifdef INET6
+		case AF_INET6:
+			/* XXX */
+			ipsec6_output_trans()
+			ipsec6_output_tunnel()
+			/* NOTREACHED */
+#endif /* INET6 */
+#endif
+		default:
+			DPRINTF(("%s: unknown protocol family %u\n", __func__,
+			    saidx->dst.sa.sa_family));
+			error = ENXIO;
+			goto bad;
+		}
 	}
 	key_sa_recordxfer(sav, m);		/* record data transfer */
 

Modified: head/sys/netipsec/key.c
==============================================================================
--- head/sys/netipsec/key.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/key.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -73,7 +73,7 @@
 #include 
 #endif /* INET6 */
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
 #include 
 #endif
 #ifdef INET6

Modified: head/sys/netipsec/xform_ah.c
==============================================================================
--- head/sys/netipsec/xform_ah.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/xform_ah.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -91,6 +91,7 @@ VNET_DEFINE(int, ah_enable) = 1;	/* cont
 VNET_DEFINE(int, ah_cleartos) = 1;	/* clear ip_tos when doing AH calc */
 VNET_DEFINE(struct ahstat, ahstat);
 
+#ifdef INET
 SYSCTL_DECL(_net_inet_ah);
 SYSCTL_VNET_INT(_net_inet_ah, OID_AUTO,
 	ah_enable,	CTLFLAG_RW,	&VNET_NAME(ah_enable),	0, "");
@@ -98,6 +99,7 @@ SYSCTL_VNET_INT(_net_inet_ah, OID_AUTO,
 	ah_cleartos,	CTLFLAG_RW,	&VNET_NAME(ah_cleartos), 0, "");
 SYSCTL_VNET_STRUCT(_net_inet_ah, IPSECCTL_STATS,
 	stats,		CTLFLAG_RD,	&VNET_NAME(ahstat), ahstat, "");
+#endif
 
 static unsigned char ipseczeroes[256];	/* larger than an ip6 extension hdr */
 
@@ -724,19 +726,6 @@ ah_input(struct mbuf *m, struct secasvar
 		return ah_input_cb(crp);
 }
 
-#ifdef INET6
-#define	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag) do {		     \
-	if (saidx->dst.sa.sa_family == AF_INET6) {			     \
-		error = ipsec6_common_input_cb(m, sav, skip, protoff, mtag); \
-	} else {							     \
-		error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag); \
-	}								     \
-} while (0)
-#else
-#define	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag)		     \
-	(error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag))
-#endif
-
 /*
  * AH input callback from the crypto driver.
  */
@@ -873,7 +862,21 @@ ah_input_cb(struct cryptop *crp)
 		goto bad;
 	}
 
-	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag);
+	switch (saidx->dst.sa.sa_family) {
+#ifdef INET6
+	case AF_INET6:
+		error = ipsec6_common_input_cb(m, sav, skip, protoff, mtag);
+		break;
+#endif
+#ifdef INET
+	case AF_INET:
+		error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag);
+		break;
+#endif
+	default:
+		panic("%s: Unexpected address family: %d saidx=%p", __func__,
+		    saidx->dst.sa.sa_family, saidx);
+	}
 
 	KEY_FREESAV(&sav);
 	return error;

Modified: head/sys/netipsec/xform_esp.c
==============================================================================
--- head/sys/netipsec/xform_esp.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/xform_esp.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -451,19 +451,6 @@ esp_input(struct mbuf *m, struct secasva
 		return esp_input_cb(crp);
 }
 
-#ifdef INET6
-#define	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag) do {		     \
-	if (saidx->dst.sa.sa_family == AF_INET6) {			     \
-		error = ipsec6_common_input_cb(m, sav, skip, protoff, mtag); \
-	} else {							     \
-		error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag); \
-	}								     \
-} while (0)
-#else
-#define	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag)		     \
-	(error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag))
-#endif
-
 /*
  * ESP input callback from the crypto driver.
  */
@@ -647,7 +634,21 @@ esp_input_cb(struct cryptop *crp)
 	/* Restore the Next Protocol field */
 	m_copyback(m, protoff, sizeof (u_int8_t), lastthree + 2);
 
-	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag);
+	switch (saidx->dst.sa.sa_family) {
+#ifdef INET6
+	case AF_INET6:
+		error = ipsec6_common_input_cb(m, sav, skip, protoff, mtag);
+		break;
+#endif
+#ifdef INET
+	case AF_INET:
+		error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag);
+		break;
+#endif
+	default:
+		panic("%s: Unexpected address family: %d saidx=%p", __func__,
+		    saidx->dst.sa.sa_family, saidx);
+	}
 
 	KEY_FREESAV(&sav);
 	return error;

Modified: head/sys/netipsec/xform_ipcomp.c
==============================================================================
--- head/sys/netipsec/xform_ipcomp.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/xform_ipcomp.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -213,19 +213,6 @@ ipcomp_input(struct mbuf *m, struct seca
 	return crypto_dispatch(crp);
 }
 
-#ifdef INET6
-#define	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag) do {		     \
-	if (saidx->dst.sa.sa_family == AF_INET6) {			     \
-		error = ipsec6_common_input_cb(m, sav, skip, protoff, mtag); \
-	} else {							     \
-		error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag); \
-	}								     \
-} while (0)
-#else
-#define	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, mtag)		     \
-	(error = ipsec4_common_input_cb(m, sav, skip, protoff, mtag))
-#endif
-
 /*
  * IPComp input callback from the crypto driver.
  */
@@ -316,7 +303,21 @@ ipcomp_input_cb(struct cryptop *crp)
 	/* Restore the Next Protocol field */
 	m_copyback(m, protoff, sizeof (u_int8_t), (u_int8_t *) &nproto);
 
-	IPSEC_COMMON_INPUT_CB(m, sav, skip, protoff, NULL);
+	switch (saidx->dst.sa.sa_family) {
+#ifdef INET6
+	case AF_INET6:
+		error = ipsec6_common_input_cb(m, sav, skip, protoff, NULL);
+		break;
+#endif
+#ifdef INET
+	case AF_INET:
+		error = ipsec4_common_input_cb(m, sav, skip, protoff, NULL);
+		break;
+#endif
+	default:
+		panic("%s: Unexpected address family: %d saidx=%p", __func__,
+		    saidx->dst.sa.sa_family, saidx);
+	}
 
 	KEY_FREESAV(&sav);
 	return error;

Modified: head/sys/netipsec/xform_ipip.c
==============================================================================
--- head/sys/netipsec/xform_ipip.c	Wed Apr 27 18:25:35 2011	(r221128)
+++ head/sys/netipsec/xform_ipip.c	Wed Apr 27 19:28:42 2011	(r221129)
@@ -412,8 +412,10 @@ ipip_output(
 	u_int8_t tp, otos;
 	struct secasindex *saidx;
 	int error;
-#ifdef INET
+#if defined(INET) || defined(INET6)
 	u_int8_t itos;
+#endif
+#ifdef INET
 	struct ip *ipo;
 #endif /* INET */
 #ifdef INET6
@@ -466,7 +468,8 @@ ipip_output(
 		ipo->ip_id = ip_newid();
 
 		/* If the inner protocol is IP... */
-		if (tp == IPVERSION) {
+		switch (tp) {
+		case IPVERSION:
 			/* Save ECN notification */
 			m_copydata(m, sizeof(struct ip) +
 			    offsetof(struct ip, ip_tos),
@@ -484,9 +487,10 @@ ipip_output(
 			ipo->ip_off = ntohs(ipo->ip_off);
 			ipo->ip_off &= ~(IP_DF | IP_MF | IP_OFFMASK);
 			ipo->ip_off = htons(ipo->ip_off);
-		}
+			break;
 #ifdef INET6
-		else if (tp == (IPV6_VERSION >> 4)) {
+		case (IPV6_VERSION >> 4):
+		{
 			u_int32_t itos32;
 
 			/* Save ECN notification. */
@@ -496,9 +500,10 @@ ipip_output(
 			itos = ntohl(itos32) >> 20;
 			ipo->ip_p = IPPROTO_IPV6;
 			ipo->ip_off = 0;
+			break;
 		}
 #endif /* INET6 */
-		else {
+		default:
 			goto nofamily;
 		}
 
@@ -547,8 +552,9 @@ ipip_output(
 		ip6o->ip6_dst = saidx->dst.sin6.sin6_addr;
 		ip6o->ip6_src = saidx->src.sin6.sin6_addr;
 
+		switch (tp) {
 #ifdef INET
-		if (tp == IPVERSION) {
+		case IPVERSION:
 			/* Save ECN notification */
 			m_copydata(m, sizeof(struct ip6_hdr) +
 			    offsetof(struct ip, ip_tos), sizeof(u_int8_t),
@@ -556,21 +562,23 @@ ipip_output(
 
 			/* This is really IPVERSION. */
 			ip6o->ip6_nxt = IPPROTO_IPIP;
-		} else
+			break;
 #endif /* INET */
-			if (tp == (IPV6_VERSION >> 4)) {
-				u_int32_t itos32;
+		case (IPV6_VERSION >> 4):
+		{
+			u_int32_t itos32;
+
+			/* Save ECN notification. */
+			m_copydata(m, sizeof(struct ip6_hdr) +
+			    offsetof(struct ip6_hdr, ip6_flow),
+			    sizeof(u_int32_t), (caddr_t) &itos32);
+			itos = ntohl(itos32) >> 20;
 
-				/* Save ECN notification. */
-				m_copydata(m, sizeof(struct ip6_hdr) +
-				    offsetof(struct ip6_hdr, ip6_flow),
-				    sizeof(u_int32_t), (caddr_t) &itos32);
-				itos = ntohl(itos32) >> 20;
-
-				ip6o->ip6_nxt = IPPROTO_IPV6;
-			} else {
-				goto nofamily;
-			}
+			ip6o->ip6_nxt = IPPROTO_IPV6;
+		}
+		default:
+			goto nofamily;
+		}
 
 		otos = 0;
 		ip_ecn_ingress(ECN_ALLOWED, &otos, &itos);
@@ -622,6 +630,7 @@ bad:
 }
 
 #ifdef IPSEC
+#if defined(INET) || defined(INET6)
 static int
 ipe4_init(struct secasvar *sav, struct xformsw *xsp)
 {
@@ -652,6 +661,8 @@ static struct xformsw ipe4_xformsw = {
 };
 
 extern struct domain inetdomain;
+#endif /* INET || INET6 */
+#ifdef INET
 static struct protosw ipe4_protosw = {
 	.pr_type =	SOCK_RAW,
 	.pr_domain =	&inetdomain,
@@ -661,7 +672,8 @@ static struct protosw ipe4_protosw = {
 	.pr_ctloutput =	rip_ctloutput,
 	.pr_usrreqs =	&rip_usrreqs
 };
-#ifdef INET6
+#endif /* INET */
+#if defined(INET6) && defined(INET)
 static struct ip6protosw ipe6_protosw = {
 	.pr_type =	SOCK_RAW,
 	.pr_domain =	&inetdomain,
@@ -671,8 +683,9 @@ static struct ip6protosw ipe6_protosw = 
 	.pr_ctloutput =	rip_ctloutput,
 	.pr_usrreqs =	&rip_usrreqs
 };
-#endif
+#endif /* INET6 && INET */
 
+#if defined(INET)
 /*
  * Check the encapsulated packet to see if we want it
  */
@@ -687,6 +700,7 @@ ipe4_encapcheck(const struct mbuf *m, in
 	 */
 	return ((m->m_flags & M_IPSEC) != 0 ? 1 : 0);
 }
+#endif /* INET */
 
 static void
 ipe4_attach(void)
@@ -695,9 +709,11 @@ ipe4_attach(void)
 	xform_register(&ipe4_xformsw);
 	/* attach to encapsulation framework */
 	/* XXX save return cookie for detach on module remove */
+#ifdef INET
 	(void) encap_attach_func(AF_INET, -1,
 		ipe4_encapcheck, &ipe4_protosw, NULL);
-#ifdef INET6
+#endif
+#if defined(INET6) && defined(INET)
 	(void) encap_attach_func(AF_INET6, -1,
 		ipe4_encapcheck, (struct protosw *)&ipe6_protosw, NULL);
 #endif

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:30:45 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 410DA1065670;
	Wed, 27 Apr 2011 19:30:45 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 27A5C8FC0A;
	Wed, 27 Apr 2011 19:30:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RJUjBf085847;
	Wed, 27 Apr 2011 19:30:45 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RJUi1r085842;
	Wed, 27 Apr 2011 19:30:44 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104271930.p3RJUi1r085842@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 27 Apr 2011 19:30:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221130 - in head/sys: dev/xen/netfront net netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:30:45 -0000

Author: bz
Date: Wed Apr 27 19:30:44 2011
New Revision: 221130
URL: http://svn.freebsd.org/changeset/base/221130

Log:
  Make various (pseudo) interfaces compile without INET in the kernel
  adding appropriate #ifdefs.  For module builds the framework needs
  adjustments for at least carp.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/dev/xen/netfront/netfront.c
  head/sys/net/if_enc.c
  head/sys/net/if_lagg.c
  head/sys/netinet/ip_carp.c

Modified: head/sys/dev/xen/netfront/netfront.c
==============================================================================
--- head/sys/dev/xen/netfront/netfront.c	Wed Apr 27 19:28:42 2011	(r221129)
+++ head/sys/dev/xen/netfront/netfront.c	Wed Apr 27 19:30:44 2011	(r221130)
@@ -28,6 +28,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
+
 #include 
 #include 
 #include 
@@ -625,6 +627,7 @@ setup_device(device_t dev, struct netfro
 	return (error);
 }
 
+#ifdef INET
 /**
  * If this interface has an ipv4 address, send an arp for it. This
  * helps to get the network going again after migrating hosts.
@@ -642,6 +645,7 @@ netfront_send_fake_arp(device_t dev, str
 		}
 	}
 }
+#endif
 
 /**
  * Callback received when the backend's state changes.
@@ -668,7 +672,9 @@ netfront_backend_changed(device_t dev, X
 		if (network_connect(sc) != 0)
 			break;
 		xenbus_set_state(dev, XenbusStateConnected);
+#ifdef INET
 		netfront_send_fake_arp(dev, sc);
+#endif
 		break;
 	case XenbusStateClosing:
 		xenbus_set_state(dev, XenbusStateClosed);
@@ -1725,12 +1731,15 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, 
 {
 	struct netfront_info *sc = ifp->if_softc;
 	struct ifreq *ifr = (struct ifreq *) data;
+#ifdef INET
 	struct ifaddr *ifa = (struct ifaddr *)data;
+#endif
 
 	int mask, error = 0;
 	switch(cmd) {
 	case SIOCSIFADDR:
 	case SIOCGIFADDR:
+#ifdef INET
 		XN_LOCK(sc);
 		if (ifa->ifa_addr->sa_family == AF_INET) {
 			ifp->if_flags |= IFF_UP;
@@ -1740,8 +1749,11 @@ xn_ioctl(struct ifnet *ifp, u_long cmd, 
 			XN_UNLOCK(sc);	
 		} else {
 			XN_UNLOCK(sc);	
+#endif
 			error = ether_ioctl(ifp, cmd, data);
+#ifdef INET
 		}
+#endif
 		break;
 	case SIOCSIFMTU:
 		/* XXX can we alter the MTU on a VN ?*/

Modified: head/sys/net/if_enc.c
==============================================================================
--- head/sys/net/if_enc.c	Wed Apr 27 19:28:42 2011	(r221129)
+++ head/sys/net/if_enc.c	Wed Apr 27 19:30:44 2011	(r221130)
@@ -27,6 +27,10 @@
  * $FreeBSD$
  */
 
+#include "opt_inet.h"
+#include "opt_inet6.h"
+#include "opt_enc.h"
+
 #include 
 #include 
 #include 
@@ -53,14 +57,12 @@
 #include 
 #include 
 #include 
-#include "opt_inet6.h"
 
 #ifdef INET6
 #include 
 #include 
 #endif
 
-#include "opt_enc.h"
 #include 
 #include 
 
@@ -243,11 +245,14 @@ ipsec_filter(struct mbuf **mp, int dir, 
 	}
 
 	/* Skip pfil(9) if no filters are loaded */
-	if (!(PFIL_HOOKED(&V_inet_pfil_hook)
+	if (1
+#ifdef INET
+	    && !PFIL_HOOKED(&V_inet_pfil_hook)
+#endif
 #ifdef INET6
-	    || PFIL_HOOKED(&V_inet6_pfil_hook)
+	    && !PFIL_HOOKED(&V_inet6_pfil_hook)
 #endif
-	    )) {
+	    ) {
 		return (0);
 	}
 
@@ -263,6 +268,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
 	error = 0;
 	ip = mtod(*mp, struct ip *);
 	switch (ip->ip_v) {
+#ifdef INET
 		case 4:
 			/*
 			 * before calling the firewall, swap fields the same as
@@ -282,7 +288,7 @@ ipsec_filter(struct mbuf **mp, int dir, 
 			ip->ip_len = htons(ip->ip_len);
 			ip->ip_off = htons(ip->ip_off);
 			break;
-
+#endif
 #ifdef INET6
 		case 6:
 			error = pfil_run_hooks(&V_inet6_pfil_hook, mp,

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Wed Apr 27 19:28:42 2011	(r221129)
+++ head/sys/net/if_lagg.c	Wed Apr 27 19:30:44 2011	(r221130)
@@ -52,8 +52,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
 #include 
+#endif
+#ifdef INET
 #include 
 #include 
 #include 

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Wed Apr 27 19:28:42 2011	(r221129)
+++ head/sys/netinet/ip_carp.c	Wed Apr 27 19:30:44 2011	(r221130)
@@ -66,14 +66,19 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef INET
+#if defined(INET) || defined(INET6)
 #include 
 #include 
-#include 
+#include 
 #include 
+
+#include 
+#endif
+
+#ifdef INET
+#include 
 #include 
 #include 
-#include 
 #endif
 
 #ifdef INET6
@@ -82,11 +87,11 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #endif
 
 #include 
-#include 
 
 #define	CARP_IFNAME	"carp"
 static MALLOC_DEFINE(M_CARP, "CARP", "CARP interfaces");
@@ -96,7 +101,9 @@ struct carp_softc {
 	struct ifnet	 	*sc_ifp;	/* Interface clue */
 	struct ifnet		*sc_carpdev;	/* Pointer to parent interface */
 	struct in_ifaddr 	*sc_ia;		/* primary iface address */
+#ifdef INET
 	struct ip_moptions 	 sc_imo;
+#endif
 #ifdef INET6
 	struct in6_ifaddr 	*sc_ia6;	/* primary iface address v6 */
 	struct ip6_moptions 	 sc_im6o;
@@ -206,7 +213,9 @@ static int	carp_prepare_ad(struct mbuf *
 static void	carp_send_ad_all(void);
 static void	carp_send_ad(void *);
 static void	carp_send_ad_locked(struct carp_softc *);
+#ifdef INET
 static void	carp_send_arp(struct carp_softc *);
+#endif
 static void	carp_master_down(void *);
 static void	carp_master_down_locked(struct carp_softc *);
 static int	carp_ioctl(struct ifnet *, u_long, caddr_t);
@@ -215,12 +224,16 @@ static int	carp_looutput(struct ifnet *,
 static void	carp_start(struct ifnet *);
 static void	carp_setrun(struct carp_softc *, sa_family_t);
 static void	carp_set_state(struct carp_softc *, int);
+#ifdef INET
 static int	carp_addrcount(struct carp_if *, struct in_ifaddr *, int);
+#endif
 enum	{ CARP_COUNT_MASTER, CARP_COUNT_RUNNING };
 
+#ifdef INET
 static void	carp_multicast_cleanup(struct carp_softc *, int dofree);
 static int	carp_set_addr(struct carp_softc *, struct sockaddr_in *);
 static int	carp_del_addr(struct carp_softc *, struct sockaddr_in *);
+#endif
 static void	carp_carpdev_state_locked(struct carp_if *);
 static void	carp_sc_state_locked(struct carp_softc *);
 #ifdef INET6
@@ -369,6 +382,7 @@ carp_setroute(struct carp_softc *sc, int
 
 	s = splnet();
 	TAILQ_FOREACH(ifa, &SC2IFP(sc)->if_addrlist, ifa_list) {
+#ifdef INET
 		if (ifa->ifa_addr->sa_family == AF_INET &&
 		    sc->sc_carpdev != NULL) {
 			int count = carp_addrcount(
@@ -379,6 +393,7 @@ carp_setroute(struct carp_softc *sc, int
 			    (cmd == RTM_DELETE && count == 0))
 				rtinit(ifa, cmd, RTF_UP | RTF_HOST);
 		}
+#endif
 	}
 	splx(s);
 }
@@ -404,12 +419,14 @@ carp_clone_create(struct if_clone *ifc, 
 	sc->sc_advskew = 0;
 	sc->sc_init_counter = 1;
 	sc->sc_naddrs = sc->sc_naddrs6 = 0; /* M_ZERO? */
+#ifdef INET
 	sc->sc_imo.imo_membership = (struct in_multi **)malloc(
 	    (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_CARP,
 	    M_WAITOK);
 	sc->sc_imo.imo_mfilters = NULL;
 	sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS;
 	sc->sc_imo.imo_multicast_vif = -1;
+#endif
 #ifdef INET6
 	sc->sc_im6o.im6o_membership = (struct in6_multi **)malloc(
 	    (sizeof(struct in6_multi *) * IPV6_MIN_MEMBERSHIPS), M_CARP,
@@ -456,7 +473,9 @@ carp_clone_destroy(struct ifnet *ifp)
 	bpfdetach(ifp);
 	if_detach(ifp);
 	if_free_type(ifp, IFT_ETHER);
+#ifdef INET
 	free(sc->sc_imo.imo_membership, M_CARP);
+#endif
 #ifdef INET6
 	free(sc->sc_im6o.im6o_membership, M_CARP);
 #endif
@@ -495,7 +514,9 @@ carpdetach(struct carp_softc *sc, int un
 	carp_set_state(sc, INIT);
 	SC2IFP(sc)->if_flags &= ~IFF_UP;
 	carp_setrun(sc, 0);
+#ifdef INET
 	carp_multicast_cleanup(sc, unlock);
+#endif
 #ifdef INET6
 	carp_multicast6_cleanup(sc, unlock);
 #endif
@@ -540,6 +561,7 @@ carp_ifdetach(void *arg __unused, struct
  * we have rearranged checks order compared to the rfc,
  * but it seems more efficient this way or not possible otherwise.
  */
+#ifdef INET
 void
 carp_input(struct mbuf *m, int hlen)
 {
@@ -630,6 +652,7 @@ carp_input(struct mbuf *m, int hlen)
 
 	carp_input_c(m, ch, AF_INET);
 }
+#endif
 
 #ifdef INET6
 int
@@ -720,12 +743,16 @@ carp_input_c(struct mbuf *m, struct carp
 	SC2IFP(sc)->if_ibytes += m->m_pkthdr.len;
 
 	if (bpf_peers_present(SC2IFP(sc)->if_bpf)) {
-		struct ip *ip = mtod(m, struct ip *);
 		uint32_t af1 = af;
+#ifdef INET
+		struct ip *ip = mtod(m, struct ip *);
 
 		/* BPF wants net byte order */
-		ip->ip_len = htons(ip->ip_len + (ip->ip_hl << 2));
-		ip->ip_off = htons(ip->ip_off);
+		if (af == AF_INET) {
+			ip->ip_len = htons(ip->ip_len + (ip->ip_hl << 2));
+			ip->ip_off = htons(ip->ip_off);
+		}
+#endif
 		bpf_mtap2(SC2IFP(sc)->if_bpf, &af1, sizeof(af1), m);
 	}
 
@@ -1081,6 +1108,7 @@ carp_send_ad_locked(struct carp_softc *s
 
 }
 
+#ifdef INET
 /*
  * Broadcast a gratuitous ARP request containing
  * the virtual router MAC address for each IP address
@@ -1102,6 +1130,7 @@ carp_send_arp(struct carp_softc *sc)
 		DELAY(1000);	/* XXX */
 	}
 }
+#endif
 
 #ifdef INET6
 static void
@@ -1124,6 +1153,7 @@ carp_send_na(struct carp_softc *sc)
 }
 #endif /* INET6 */
 
+#ifdef INET
 static int
 carp_addrcount(struct carp_if *cif, struct in_ifaddr *ia, int type)
 {
@@ -1227,6 +1257,7 @@ carp_iamatch(struct ifnet *ifp, struct i
 	CARP_UNLOCK(cif);
 	return (0);
 }
+#endif
 
 #ifdef INET6
 struct ifaddr *
@@ -1353,7 +1384,9 @@ carp_master_down_locked(struct carp_soft
 	case BACKUP:
 		carp_set_state(sc, MASTER);
 		carp_send_ad_locked(sc);
+#ifdef INET
 		carp_send_arp(sc);
+#endif
 #ifdef INET6
 		carp_send_na(sc);
 #endif /* INET6 */
@@ -1393,7 +1426,9 @@ carp_setrun(struct carp_softc *sc, sa_fa
 	case INIT:
 		if (carp_opts[CARPCTL_PREEMPT] && !carp_suppress_preempt) {
 			carp_send_ad_locked(sc);
+#ifdef INET
 			carp_send_arp(sc);
+#endif
 #ifdef INET6
 			carp_send_na(sc);
 #endif /* INET6 */
@@ -1444,6 +1479,7 @@ carp_setrun(struct carp_softc *sc, sa_fa
 	}
 }
 
+#ifdef INET
 static void
 carp_multicast_cleanup(struct carp_softc *sc, int dofree)
 {
@@ -1463,6 +1499,7 @@ carp_multicast_cleanup(struct carp_softc
 	imo->imo_num_memberships = 0;
 	imo->imo_multicast_ifp = NULL;
 }
+#endif
 
 #ifdef INET6
 static void
@@ -1485,6 +1522,7 @@ carp_multicast6_cleanup(struct carp_soft
 }
 #endif
 
+#ifdef INET
 static int
 carp_set_addr(struct carp_softc *sc, struct sockaddr_in *sin)
 {
@@ -1661,6 +1699,7 @@ carp_del_addr(struct carp_softc *sc, str
 
 	return (error);
 }
+#endif
 
 #ifdef INET6
 static int

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:32:28 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49AB61065672;
	Wed, 27 Apr 2011 19:32:28 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3AF8A8FC13;
	Wed, 27 Apr 2011 19:32:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RJWSb6085947;
	Wed, 27 Apr 2011 19:32:28 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RJWSuC085944;
	Wed, 27 Apr 2011 19:32:28 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104271932.p3RJWSuC085944@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 27 Apr 2011 19:32:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221131 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:32:28 -0000

Author: bz
Date: Wed Apr 27 19:32:27 2011
New Revision: 221131
URL: http://svn.freebsd.org/changeset/base/221131

Log:
  MfP4 CH=192004:
  
  Move ip_defttl to raw_ip.c where it is actually used.  In an IPv6
  only world we do not want to compile ip_input.c in for that and
  it is a shared default with INET6.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/netinet/ip_input.c
  head/sys/netinet/raw_ip.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Wed Apr 27 19:30:44 2011	(r221130)
+++ head/sys/netinet/ip_input.c	Wed Apr 27 19:32:27 2011	(r221131)
@@ -101,11 +101,6 @@ SYSCTL_VNET_INT(_net_inet_ip, IPCTL_SEND
     &VNET_NAME(ipsendredirects), 0,
     "Enable sending IP redirects");
 
-VNET_DEFINE(int, ip_defttl) = IPDEFTTL;
-SYSCTL_VNET_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
-    &VNET_NAME(ip_defttl), 0,
-    "Maximum TTL on IP packets");
-
 static VNET_DEFINE(int, ip_keepfaith);
 #define	V_ip_keepfaith		VNET(ip_keepfaith)
 SYSCTL_VNET_INT(_net_inet_ip, IPCTL_KEEPFAITH, keepfaith, CTLFLAG_RW,

Modified: head/sys/netinet/raw_ip.c
==============================================================================
--- head/sys/netinet/raw_ip.c	Wed Apr 27 19:30:44 2011	(r221130)
+++ head/sys/netinet/raw_ip.c	Wed Apr 27 19:32:27 2011	(r221131)
@@ -74,6 +74,11 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+VNET_DEFINE(int, ip_defttl) = IPDEFTTL;
+SYSCTL_VNET_INT(_net_inet_ip, IPCTL_DEFTTL, ttl, CTLFLAG_RW,
+    &VNET_NAME(ip_defttl), 0,
+    "Maximum TTL on IP packets");
+
 VNET_DEFINE(struct inpcbhead, ripcb);
 VNET_DEFINE(struct inpcbinfo, ripcbinfo);
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:34:02 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DCA29106564A;
	Wed, 27 Apr 2011 19:34:01 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C33F58FC13;
	Wed, 27 Apr 2011 19:34:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RJY1Bn086058;
	Wed, 27 Apr 2011 19:34:01 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RJY1Fq086054;
	Wed, 27 Apr 2011 19:34:01 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104271934.p3RJY1Fq086054@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 27 Apr 2011 19:34:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221132 - head/sys/contrib/pf/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:34:02 -0000

Author: bz
Date: Wed Apr 27 19:34:01 2011
New Revision: 221132
URL: http://svn.freebsd.org/changeset/base/221132

Log:
  Make pf compile without INET support by adding #ifdef INETs and
  correcting few #includes.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/contrib/pf/net/if_pflog.c
  head/sys/contrib/pf/net/pf.c
  head/sys/contrib/pf/net/pf_ioctl.c

Modified: head/sys/contrib/pf/net/if_pflog.c
==============================================================================
--- head/sys/contrib/pf/net/if_pflog.c	Wed Apr 27 19:32:27 2011	(r221131)
+++ head/sys/contrib/pf/net/if_pflog.c	Wed Apr 27 19:34:01 2011	(r221132)
@@ -82,17 +82,17 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#ifdef	INET
+#if defined(INET) || defined(INET6)
 #include 
+#endif
+#ifdef	INET
 #include 
 #include 
 #include 
 #endif
 
 #ifdef INET6
-#ifndef INET
-#include 
-#endif
+#include 
 #include 
 #endif /* INET6 */
 

Modified: head/sys/contrib/pf/net/pf.c
==============================================================================
--- head/sys/contrib/pf/net/pf.c	Wed Apr 27 19:32:27 2011	(r221131)
+++ head/sys/contrib/pf/net/pf.c	Wed Apr 27 19:34:01 2011	(r221132)
@@ -2039,8 +2039,10 @@ pf_send_icmp(struct mbuf *m, u_int8_t ty
 	struct pf_mtag	*pf_mtag;
 	struct mbuf	*m0;
 #ifdef __FreeBSD__
+#ifdef INET
 	struct ip *ip;
 #endif
+#endif
 
 #ifdef __FreeBSD__
 	m0 = m_copypacket(m, M_DONTWAIT);

Modified: head/sys/contrib/pf/net/pf_ioctl.c
==============================================================================
--- head/sys/contrib/pf/net/pf_ioctl.c	Wed Apr 27 19:32:27 2011	(r221131)
+++ head/sys/contrib/pf/net/pf_ioctl.c	Wed Apr 27 19:34:01 2011	(r221132)
@@ -216,10 +216,12 @@ static void		 pf_clear_srcnodes(void);
 /*
  * Wrapper functions for pfil(9) hooks
  */
+#ifdef INET
 static int pf_check_in(void *arg, struct mbuf **m, struct ifnet *ifp,
 		int dir, struct inpcb *inp);
 static int pf_check_out(void *arg, struct mbuf **m, struct ifnet *ifp,
 		int dir, struct inpcb *inp);
+#endif
 #ifdef INET6
 static int pf_check6_in(void *arg, struct mbuf **m, struct ifnet *ifp,
 		int dir, struct inpcb *inp);
@@ -3622,6 +3624,7 @@ shutdown_pf(void)
         return (error);
 }
 
+#ifdef INET
 static int
 pf_check_in(void *arg, struct mbuf **m, struct ifnet *ifp, int dir,
     struct inpcb *inp)
@@ -3696,6 +3699,7 @@ pf_check_out(void *arg, struct mbuf **m,
 	}
 	return chk;
 }
+#endif
 
 #ifdef INET6
 static int
@@ -3761,15 +3765,19 @@ hook_pf(void)
 	pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
 	if (pfh_inet == NULL)
 		return (ESRCH); /* XXX */
+#ifdef INET
 	pfil_add_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet);
 	pfil_add_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK, pfh_inet);
+#endif
 #ifdef INET6
 	pfh_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6);
 	if (pfh_inet6 == NULL) {
+#ifdef INET
 		pfil_remove_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK,
 		    pfh_inet);
 		pfil_remove_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK,
 		    pfh_inet);
+#endif
 		return (ESRCH); /* XXX */
 	}
 	pfil_add_hook(pf_check6_in, NULL, PFIL_IN | PFIL_WAITOK, pfh_inet6);
@@ -3796,10 +3804,12 @@ dehook_pf(void)
 	pfh_inet = pfil_head_get(PFIL_TYPE_AF, AF_INET);
 	if (pfh_inet == NULL)
 		return (ESRCH); /* XXX */
+#ifdef INET
 	pfil_remove_hook(pf_check_in, NULL, PFIL_IN | PFIL_WAITOK,
 	    pfh_inet);
 	pfil_remove_hook(pf_check_out, NULL, PFIL_OUT | PFIL_WAITOK,
 	    pfh_inet);
+#endif
 #ifdef INET6
 	pfh_inet6 = pfil_head_get(PFIL_TYPE_AF, AF_INET6);
 	if (pfh_inet6 == NULL)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:35:51 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 059701065678;
	Wed, 27 Apr 2011 19:35:51 +0000 (UTC) (envelope-from obrien@NUXI.org)
Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85])
	by mx1.freebsd.org (Postfix) with ESMTP id D94228FC19;
	Wed, 27 Apr 2011 19:35:50 +0000 (UTC)
Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1])
	by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id p3RJZo4K079816;
	Wed, 27 Apr 2011 12:35:50 -0700 (PDT)
	(envelope-from obrien@dragon.nuxi.org)
Received: (from obrien@localhost)
	by dragon.nuxi.org (8.14.4/8.14.4/Submit) id p3RJZowf079815;
	Wed, 27 Apr 2011 12:35:50 -0700 (PDT) (envelope-from obrien)
Date: Wed, 27 Apr 2011 12:35:50 -0700
From: "David O'Brien" 
To: John Baldwin 
Message-ID: <20110427193550.GA79786@dragon.NUXI.org>
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104260932.44199.jhb@freebsd.org>
	<20110426222641.GA44259@dragon.NUXI.org>
	<201104271048.33325.jhb@freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201104271048.33325.jhb@freebsd.org>
X-Operating-System: FreeBSD 9.0-CURRENT
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN?
User-Agent: Mutt/1.5.16 (2007-06-09)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: obrien@freebsd.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:35:51 -0000

On Wed, Apr 27, 2011 at 10:48:33AM -0400, John Baldwin wrote:
> For changing WARNS, 'make universe' works well

I have to disagree.  Due to its silent failing, it is only suitable for
what PHK added it for -- "what if" changes.
[Message-ID: <13101.1227520743@critter.freebsd.dk>]

One has to do all the various greps of the output in order to be
confident of their belief of the results.

We really need a new target that builds more normal (fails on first
error) and makes it obvious when there is a failure.

-- 
-- David  (obrien@FreeBSD.org)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:36:35 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 959BC106564A;
	Wed, 27 Apr 2011 19:36:35 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 866258FC2C;
	Wed, 27 Apr 2011 19:36:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RJaZbW086225;
	Wed, 27 Apr 2011 19:36:35 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RJaZH1086222;
	Wed, 27 Apr 2011 19:36:35 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104271936.p3RJaZH1086222@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 27 Apr 2011 19:36:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221134 - in head/sys: conf netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:36:35 -0000

Author: bz
Date: Wed Apr 27 19:36:35 2011
New Revision: 221134
URL: http://svn.freebsd.org/changeset/base/221134

Log:
  MfP4 CH=192029:
  
  Expose ip_icmp.c to INET6 as well and only export badport_bandlim()
  along with the two sysctls in the non-INET case.
  The bandlim types work for all cases I reviewed in IPv6 as well and
  the sysctls are available as we export net.inet.* from in_proto.c.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/conf/files
  head/sys/netinet/ip_icmp.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Apr 27 19:36:00 2011	(r221133)
+++ head/sys/conf/files	Wed Apr 27 19:36:35 2011	(r221134)
@@ -2707,7 +2707,7 @@ netinet/ipfw/ip_fw_pfil.c	optional inet 
 netinet/ipfw/ip_fw_sockopt.c	optional inet ipfirewall
 netinet/ipfw/ip_fw_table.c	optional inet ipfirewall
 netinet/ipfw/ip_fw_nat.c	optional inet ipfirewall_nat
-netinet/ip_icmp.c		optional inet
+netinet/ip_icmp.c		optional inet | inet6
 netinet/ip_input.c		optional inet
 netinet/ip_ipsec.c		optional inet ipsec
 netinet/ip_mroute.c		optional mrouting inet | mrouting inet6

Modified: head/sys/netinet/ip_icmp.c
==============================================================================
--- head/sys/netinet/ip_icmp.c	Wed Apr 27 19:36:00 2011	(r221133)
+++ head/sys/netinet/ip_icmp.c	Wed Apr 27 19:36:35 2011	(r221134)
@@ -32,6 +32,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_inet.h"
 #include "opt_ipsec.h"
 
 #include 
@@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef INET
 #ifdef IPSEC
 #include 
 #include 
@@ -70,12 +72,26 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#endif /* INET */
 
 /*
  * ICMP routines: error generation, receive packet processing, and
  * routines to turnaround packets back to the originator, and
  * host table maintenance routines.
  */
+static VNET_DEFINE(int, icmplim) = 200;
+#define	V_icmplim			VNET(icmplim)
+SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW,
+	&VNET_NAME(icmplim), 0,
+	"Maximum number of ICMP responses per second");
+
+static VNET_DEFINE(int, icmplim_output) = 1;
+#define	V_icmplim_output		VNET(icmplim_output)
+SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW,
+	&VNET_NAME(icmplim_output), 0,
+	"Enable rate limiting of ICMP responses");
+
+#ifdef INET
 VNET_DEFINE(struct icmpstat, icmpstat);
 SYSCTL_VNET_STRUCT(_net_inet_icmp, ICMPCTL_STATS, stats, CTLFLAG_RW,
 	&VNET_NAME(icmpstat), icmpstat, "");
@@ -104,18 +120,6 @@ SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO
 	&VNET_NAME(log_redirect), 0,
 	"Log ICMP redirects to the console");
 
-static VNET_DEFINE(int, icmplim) = 200;
-#define	V_icmplim			VNET(icmplim)
-SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW,
-	&VNET_NAME(icmplim), 0,
-	"Maximum number of ICMP responses per second");
-
-static VNET_DEFINE(int, icmplim_output) = 1;
-#define	V_icmplim_output		VNET(icmplim_output)
-SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW,
-	&VNET_NAME(icmplim_output), 0,
-	"Enable rate limiting of ICMP responses");
-
 static VNET_DEFINE(char, reply_src[IFNAMSIZ]);
 #define	V_reply_src			VNET(reply_src)
 SYSCTL_VNET_STRING(_net_inet_icmp, OID_AUTO, reply_src, CTLFLAG_RW,
@@ -922,6 +926,7 @@ ip_next_mtu(int mtu, int dir)
 	}
 	return 0;
 }
+#endif /* INET */
 
 
 /*

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:39:57 2011
Return-Path: 
Delivered-To: svn-src-head@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 153F31065670;
	Wed, 27 Apr 2011 19:39:57 +0000 (UTC) (envelope-from obrien@NUXI.org)
Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85])
	by mx1.freebsd.org (Postfix) with ESMTP id E90B58FC13;
	Wed, 27 Apr 2011 19:39:55 +0000 (UTC)
Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1])
	by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id p3RJdi6Z079904;
	Wed, 27 Apr 2011 12:39:44 -0700 (PDT)
	(envelope-from obrien@dragon.nuxi.org)
Received: (from obrien@localhost)
	by dragon.nuxi.org (8.14.4/8.14.4/Submit) id p3RJdi5x079903;
	Wed, 27 Apr 2011 12:39:44 -0700 (PDT) (envelope-from obrien)
Date: Wed, 27 Apr 2011 12:39:44 -0700
From: "David O'Brien" 
To: Warner Losh 
Message-ID: <20110427193944.GC79786@dragon.NUXI.org>
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<1303811835.49968.6.camel@buffy.york.ac.uk>
	<67269B04-5727-4B8D-B442-D93CD0CB0A61@bsdimp.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <67269B04-5727-4B8D-B442-D93CD0CB0A61@bsdimp.com>
X-Operating-System: FreeBSD 9.0-CURRENT
X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN?
User-Agent: Mutt/1.5.16 (2007-06-09)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	Gavin Atkinson , src-committers@FreeBSD.org
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: obrien@FreeBSD.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:39:57 -0000

On Tue, Apr 26, 2011 at 07:27:11AM -0600, Warner Losh wrote:
> I read the test log as "not really tested, feel free to back it out if
> it fails on a different architecture"

Irregardless of the reasons for a build break -- one should feel free to
fix or back the change out until the change can be revisited.

> :)
:-))
 
-- 
-- David  (obrien@FreeBSD.org)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:44:51 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 84A9E106566B;
	Wed, 27 Apr 2011 19:44:51 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 596798FC1B;
	Wed, 27 Apr 2011 19:44:51 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 0084D46B42;
	Wed, 27 Apr 2011 15:44:51 -0400 (EDT)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 7AEB48A02E;
	Wed, 27 Apr 2011 15:44:50 -0400 (EDT)
From: John Baldwin 
To: obrien@freebsd.org
Date: Wed, 27 Apr 2011 15:44:47 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; )
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104271048.33325.jhb@freebsd.org>
	<20110427193550.GA79786@dragon.NUXI.org>
In-Reply-To: <20110427193550.GA79786@dragon.NUXI.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Message-Id: <201104271544.47729.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Wed, 27 Apr 2011 15:44:50 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:44:51 -0000

On Wednesday, April 27, 2011 3:35:50 pm David O'Brien wrote:
> On Wed, Apr 27, 2011 at 10:48:33AM -0400, John Baldwin wrote:
> > For changing WARNS, 'make universe' works well
> 
> I have to disagree.  Due to its silent failing, it is only suitable for
> what PHK added it for -- "what if" changes.
> [Message-ID: <13101.1227520743@critter.freebsd.dk>]
> 
> One has to do all the various greps of the output in order to be
> confident of their belief of the results.
> 
> We really need a new target that builds more normal (fails on first
> error) and makes it obvious when there is a failure.

make tinderbox already does this.  It gives you a nice summary at the end if 
anything failed.  If things do fail, yes, you have to look in the listed files 
to find the errors, but 'make tinderbox' tells you exactly which files to 
check.  For example:

--------------------------------------------------------------
>>> make universe completed on Wed Apr 27 15:05:23 EDT 2011
                      (started Wed Apr 27 14:09:08 EDT 2011)
--------------------------------------------------------------
Tinderbox failed:
mips AR71XX kernel failed, check _.mips.AR71XX for details
mips MALTA64 kernel failed, check _.mips.MALTA64 for details
....

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 19:57:05 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 001301065672;
	Wed, 27 Apr 2011 19:57:04 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id B18298FC22;
	Wed, 27 Apr 2011 19:57:04 +0000 (UTC)
Received: from [10.30.101.54] ([209.117.142.2]) (authenticated bits=0)
	by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p3RJsGwc051380
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO);
	Wed, 27 Apr 2011 13:54:17 -0600 (MDT) (envelope-from imp@bsdimp.com)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset=us-ascii
From: Warner Losh 
In-Reply-To: <20110427193550.GA79786@dragon.NUXI.org>
Date: Wed, 27 Apr 2011 13:54:10 -0600
Content-Transfer-Encoding: 7bit
Message-Id: 
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104260932.44199.jhb@freebsd.org>
	<20110426222641.GA44259@dragon.NUXI.org>
	<201104271048.33325.jhb@freebsd.org>
	<20110427193550.GA79786@dragon.NUXI.org>
To: obrien@freebsd.org
X-Mailer: Apple Mail (2.1084)
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(harmony.bsdimp.com [10.0.0.6]);
	Wed, 27 Apr 2011 13:54:18 -0600 (MDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 19:57:05 -0000

see make tinderbox if you want first fail semantics.

On Apr 27, 2011, at 1:35 PM, David O'Brien wrote:

> On Wed, Apr 27, 2011 at 10:48:33AM -0400, John Baldwin wrote:
>> For changing WARNS, 'make universe' works well
> 
> I have to disagree.  Due to its silent failing, it is only suitable for
> what PHK added it for -- "what if" changes.
> [Message-ID: <13101.1227520743@critter.freebsd.dk>]
> 
> One has to do all the various greps of the output in order to be
> confident of their belief of the results.
> 
> We really need a new target that builds more normal (fails on first
> error) and makes it obvious when there is a failure.
> 
> -- 
> -- David  (obrien@FreeBSD.org)
> 
> 


From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 20:08:45 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 184F0106566B;
	Wed, 27 Apr 2011 20:08:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 08C2F8FC08;
	Wed, 27 Apr 2011 20:08:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RK8iok087597;
	Wed, 27 Apr 2011 20:08:44 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RK8itg087595;
	Wed, 27 Apr 2011 20:08:44 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104272008.p3RK8itg087595@svn.freebsd.org>
From: John Baldwin 
Date: Wed, 27 Apr 2011 20:08:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221138 - head/sys/dev/pci
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 20:08:45 -0000

Author: jhb
Date: Wed Apr 27 20:08:44 2011
New Revision: 221138
URL: http://svn.freebsd.org/changeset/base/221138

Log:
  Only align MSI message groups based on the number of messages being
  allocated, not the maximum number of messages the device supports.  The
  spec only requires the former, and I believe I implemented the latter due
  to misunderstanding an e-mail.  In particular, this fixes an issue where
  having several devices that all support 16 messages can run out of
  IDT vectors on x86 even though the driver only uses a single message.
  
  Submitted by:	Bret Ketchum  bcketchum of gmail
  MFC after:	1 week

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Wed Apr 27 19:54:45 2011	(r221137)
+++ head/sys/dev/pci/pci.c	Wed Apr 27 20:08:44 2011	(r221138)
@@ -1969,7 +1969,7 @@ pci_alloc_msi_method(device_t dev, devic
 	for (;;) {
 		/* Try to allocate N messages. */
 		error = PCIB_ALLOC_MSI(device_get_parent(dev), child, actual,
-		    cfg->msi.msi_msgnum, irqs);
+		    actual, irqs);
 		if (error == 0)
 			break;
 		if (actual == 1)

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 20:42:30 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAF1B106566C;
	Wed, 27 Apr 2011 20:42:30 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AF2448FC12;
	Wed, 27 Apr 2011 20:42:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RKgUKc089018;
	Wed, 27 Apr 2011 20:42:30 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RKgUYv089014;
	Wed, 27 Apr 2011 20:42:30 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104272042.p3RKgUYv089014@svn.freebsd.org>
From: Rick Macklem 
Date: Wed, 27 Apr 2011 20:42:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221139 - in head: etc/rc.d sys/fs/nfsclient
	sys/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 20:42:30 -0000

Author: rmacklem
Date: Wed Apr 27 20:42:30 2011
New Revision: 221139
URL: http://svn.freebsd.org/changeset/base/221139

Log:
  Fix module names and dependencies so the NFS clients will
  load correctly as modules after r221124.

Modified:
  head/etc/rc.d/nfsclient
  head/sys/fs/nfsclient/nfs_clvfsops.c
  head/sys/nfsclient/nfs_vfsops.c

Modified: head/etc/rc.d/nfsclient
==============================================================================
--- head/etc/rc.d/nfsclient	Wed Apr 27 20:08:44 2011	(r221138)
+++ head/etc/rc.d/nfsclient	Wed Apr 27 20:42:30 2011	(r221139)
@@ -13,7 +13,7 @@ name="nfsclient"
 rcvar="nfs_client_enable"
 start_cmd="nfsclient_start"
 stop_cmd="unmount_all"
-required_modules="nfsclient:nfs"
+required_modules="nfsclient:oldnfs"
 
 nfsclient_start()
 {

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Wed Apr 27 20:08:44 2011	(r221138)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Wed Apr 27 20:42:30 2011	(r221139)
@@ -134,7 +134,11 @@ static struct vfsops nfs_vfsops = {
 VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK);
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
-MODULE_VERSION(newnfs, 1);
+MODULE_VERSION(nfs, 1);
+MODULE_DEPEND(nfs, nfscommon, 1, 1, 1);
+MODULE_DEPEND(nfs, krpc, 1, 1, 1);
+MODULE_DEPEND(nfs, nfssvc, 1, 1, 1);
+MODULE_DEPEND(nfs, nfslock, 1, 1, 1);
 
 /*
  * This structure is now defined in sys/nfs/nfs_diskless.c so that it

Modified: head/sys/nfsclient/nfs_vfsops.c
==============================================================================
--- head/sys/nfsclient/nfs_vfsops.c	Wed Apr 27 20:08:44 2011	(r221138)
+++ head/sys/nfsclient/nfs_vfsops.c	Wed Apr 27 20:42:30 2011	(r221139)
@@ -147,13 +147,13 @@ static struct vfsops nfs_vfsops = {
 VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK);
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
-MODULE_VERSION(nfs, 1);
-MODULE_DEPEND(nfs, krpc, 1, 1, 1);
+MODULE_VERSION(oldnfs, 1);
+MODULE_DEPEND(oldnfs, krpc, 1, 1, 1);
 #ifdef KGSSAPI
-MODULE_DEPEND(nfs, kgssapi, 1, 1, 1);
+MODULE_DEPEND(oldnfs, kgssapi, 1, 1, 1);
 #endif
-MODULE_DEPEND(nfs, nfs_common, 1, 1, 1);
-MODULE_DEPEND(nfs, nfslock, 1, 1, 1);
+MODULE_DEPEND(oldnfs, nfs_common, 1, 1, 1);
+MODULE_DEPEND(oldnfs, nfslock, 1, 1, 1);
 
 static struct nfs_rpcops nfs_rpcops = {
 	nfs_readrpc,

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 21:33:57 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 281F51065674;
	Wed, 27 Apr 2011 21:33:57 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 160208FC0C;
	Wed, 27 Apr 2011 21:33:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RLXu12091356;
	Wed, 27 Apr 2011 21:33:56 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RLXuMR091354;
	Wed, 27 Apr 2011 21:33:56 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201104272133.p3RLXuMR091354@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Wed, 27 Apr 2011 21:33:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221142 - head/lib/libcrypt
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 21:33:57 -0000

Author: obrien
Date: Wed Apr 27 21:33:56 2011
New Revision: 221142
URL: http://svn.freebsd.org/changeset/base/221142

Log:
  Protect the reachover built symbols after the SHA256/512 crypt(3) addition.

Modified:
  head/lib/libcrypt/Makefile

Modified: head/lib/libcrypt/Makefile
==============================================================================
--- head/lib/libcrypt/Makefile	Wed Apr 27 21:13:40 2011	(r221141)
+++ head/lib/libcrypt/Makefile	Wed Apr 27 21:33:56 2011	(r221142)
@@ -31,7 +31,9 @@ CFLAGS+=	-I${.CURDIR} -DHAS_DES -DHAS_BL
 SRCS+=		auth.c property.c
 .for sym in auth_getval property_find properties_read properties_free \
 	    MD4Init MD4Final MD4Update MD4Pad \
-	    MD5Init MD5Final MD5Update MD5Pad
+	    MD5Init MD5Final MD5Update MD5Pad \
+	    SHA256_Init SHA256_Final SHA256_Update \
+	    SHA512_Init SHA512_Final SHA512_Update
 CFLAGS+=	-D${sym}=__${sym}
 .endfor
 

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 21:39:59 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6B6F6106566B;
	Wed, 27 Apr 2011 21:39:59 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 598458FC14;
	Wed, 27 Apr 2011 21:39:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RLdxav091644;
	Wed, 27 Apr 2011 21:39:59 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RLdxJD091642;
	Wed, 27 Apr 2011 21:39:59 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104272139.p3RLdxJD091642@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Apr 2011 21:39:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221143 - head/sbin/mdconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 21:39:59 -0000

Author: des
Date: Wed Apr 27 21:39:59 2011
New Revision: 221143
URL: http://svn.freebsd.org/changeset/base/221143

Log:
  whitespace nit

Modified:
  head/sbin/mdconfig/mdconfig.c

Modified: head/sbin/mdconfig/mdconfig.c
==============================================================================
--- head/sbin/mdconfig/mdconfig.c	Wed Apr 27 21:33:56 2011	(r221142)
+++ head/sbin/mdconfig/mdconfig.c	Wed Apr 27 21:39:59 2011	(r221143)
@@ -294,7 +294,7 @@ main(int argc, char **argv)
 	}
 	if (action == LIST) {
 		if (mdio.md_options & MD_AUTOUNIT) {
-			/* 
+			/*
 			 * Listing all devices. This is why we pass NULL
 			 * together with OPT_LIST.
 			 */

From owner-svn-src-head@FreeBSD.ORG  Wed Apr 27 21:40:49 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 677A9106567A;
	Wed, 27 Apr 2011 21:40:49 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 55AC68FC23;
	Wed, 27 Apr 2011 21:40:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3RLen8k091720;
	Wed, 27 Apr 2011 21:40:49 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3RLenvk091718;
	Wed, 27 Apr 2011 21:40:49 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104272140.p3RLenvk091718@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 27 Apr 2011 21:40:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221144 - head/sbin/mdconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Wed, 27 Apr 2011 21:40:49 -0000

Author: des
Date: Wed Apr 27 21:40:49 2011
New Revision: 221144
URL: http://svn.freebsd.org/changeset/base/221144

Log:
  whitespace nit - sorry for the churn

Modified:
  head/sbin/mdconfig/mdconfig.c

Modified: head/sbin/mdconfig/mdconfig.c
==============================================================================
--- head/sbin/mdconfig/mdconfig.c	Wed Apr 27 21:39:59 2011	(r221143)
+++ head/sbin/mdconfig/mdconfig.c	Wed Apr 27 21:40:49 2011	(r221144)
@@ -141,8 +141,8 @@ main(int argc, char **argv)
 				mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS;
 				cmdline = 2;
 			}
- 			if (cmdline != 2)
- 				usage();
+			if (cmdline != 2)
+				usage();
 			if (realpath(optarg, mdio.md_file) == NULL) {
 				err(1, "could not find full path for %s",
 				    optarg);

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 00:20:36 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E65CD106566B;
	Thu, 28 Apr 2011 00:20:35 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D1EF08FC13;
	Thu, 28 Apr 2011 00:20:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3S0KZ0T096935;
	Thu, 28 Apr 2011 00:20:35 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3S0KZLc096932;
	Thu, 28 Apr 2011 00:20:35 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104280020.p3S0KZLc096932@svn.freebsd.org>
From: Rick Macklem 
Date: Thu, 28 Apr 2011 00:20:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221145 - in head: sbin/mount_nfs share/man/man5
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 00:20:36 -0000

Author: rmacklem
Date: Thu Apr 28 00:20:35 2011
New Revision: 221145
URL: http://svn.freebsd.org/changeset/base/221145

Log:
  Update man pages related to the change in default NFS client
  applied by r221124. I also deleted references to idmapd, since that
  daemon no longer exists.
  This is a content change.

Modified:
  head/sbin/mount_nfs/mount_nfs.8
  head/share/man/man5/rc.conf.5

Modified: head/sbin/mount_nfs/mount_nfs.8
==============================================================================
--- head/sbin/mount_nfs/mount_nfs.8	Wed Apr 27 21:40:49 2011	(r221144)
+++ head/sbin/mount_nfs/mount_nfs.8	Thu Apr 28 00:20:35 2011	(r221145)
@@ -28,7 +28,7 @@
 .\"	@(#)mount_nfs.8	8.3 (Berkeley) 3/29/95
 .\" $FreeBSD$
 .\"
-.Dd July 28, 2009
+.Dd April 27, 2011
 .Dt MOUNT_NFS 8
 .Os
 .Sh NAME
@@ -63,6 +63,12 @@ It implements the mount protocol as desc
 .%T "NFS: Network File System Version 3 Protocol Specification" ,
 Appendix I.
 .Pp
+If the file system type is specified as ``oldnfs'', which implies this
+command is run as ``mount_oldnfs'', then it forces use of the old NFS
+client, which does not support the
+.Cm nfsv4
+option.
+.Pp
 By default,
 .Nm
 keeps retrying until the mount succeeds.
@@ -163,10 +169,8 @@ Note that NFS version 2 has a file size 
 Use the NFS Version 3 protocol.
 .It Cm nfsv4
 Use the NFS Version 4 protocol.
-This option will force the mount to use the experimental nfs subsystem and
+This option will force the mount to use
 TCP transport.
-To use the experimental nfs subsystem for nfsv2 and nfsv3 mounts, you
-must specify the ``newnfs'' file system type instead of ``nfs''.
 .It Cm noconn
 For UDP mount points, do not do a
 .Xr connect 2 .

Modified: head/share/man/man5/rc.conf.5
==============================================================================
--- head/share/man/man5/rc.conf.5	Wed Apr 27 21:40:49 2011	(r221144)
+++ head/share/man/man5/rc.conf.5	Thu Apr 28 00:20:35 2011	(r221145)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 22, 2011
+.Dd April 27, 2011
 .Dt RC.CONF 5
 .Os
 .Sh NAME
@@ -2024,20 +2024,63 @@ is set to
 these are the flags to pass to the
 .Xr nfsd 8
 daemon.
-.It Va idmapd_enable
+.It Va nfsv4_server_enable
 .Pq Vt bool
-If set to
+If
+.Va nfs_server_enable
+is set to
+.Dq Li YES
+and
+.Va nfsv4_server_enable
+are set to
+.Dq Li YES ,
+enable the server for NFSv4 as well as NFSv2 and NFSv3.
+.It Va nfsuserd_enable
+.Pq Vt bool
+If
+.Va nfsuserd_enable
+is set to
+.Dq Li YES ,
+run the nfsuserd daemon, which is needed for NFSv4 in order
+to map between user/group names vs uid/gid numbers.
+If
+.Va nfsv4_server_enable
+is set to
 .Dq Li YES ,
-run the ID mapping daemon for NFS version 4.
-.It Va idmapd_flags
+this will be forced enabled.
+.It Va nfsuserd_flags
 .Pq Vt str
 If
-.Va idmapd_enable
+.Va nfsuserd_enable
 is set to
 .Dq Li YES ,
 these are the flags to pass to the
-.Xr idmapd 8
+.Xr nfsuserd 8
 daemon.
+.It Va nfscbd_enable
+.Pq Vt bool
+If
+.Va nfscbd_enable
+is set to
+.Dq Li YES ,
+run the nfscbd daemon, which enables callbacks/delegations for the NFSv4 client.
+.It Va nfscbd_flags
+.Pq Vt str
+If
+.Va nfscbd_enable
+is set to
+.Dq Li YES ,
+these are the flags to pass to the
+.Xr nfscbd 8
+daemon.
+.It Va oldnfs_server_enable
+.Pq Vt bool
+If
+.Va oldnfs_server_enable
+is set to
+.Dq Li YES ,
+force the NFS server daemons to run the old NFS server code
+that does not support NFSv4.
 .It Va mountd_enable
 .Pq Vt bool
 If set to

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 08:07:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B5A551065672;
	Thu, 28 Apr 2011 08:07:54 +0000 (UTC) (envelope-from ed@hoeg.nl)
Received: from mx0.hoeg.nl (mx0.hoeg.nl [178.63.0.170])
	by mx1.freebsd.org (Postfix) with ESMTP id 730FD8FC12;
	Thu, 28 Apr 2011 08:07:54 +0000 (UTC)
Received: by mx0.hoeg.nl (Postfix, from userid 1000)
	id 7F2712A28D0A; Thu, 28 Apr 2011 09:50:09 +0200 (CEST)
Date: Thu, 28 Apr 2011 09:50:09 +0200
From: Ed Schouten 
To: David O'Brien 
Message-ID: <20110428075009.GX82526@hoeg.nl>
References: <201104260409.p3Q49KaJ006272@svn.freebsd.org>
	<201104260932.44199.jhb@freebsd.org>
	<20110426222641.GA44259@dragon.NUXI.org>
	<201104271048.33325.jhb@freebsd.org>
	<20110427193550.GA79786@dragon.NUXI.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="XCIqNWEteo88hZlY"
Content-Disposition: inline
In-Reply-To: <20110427193550.GA79786@dragon.NUXI.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, John Baldwin 
Subject: Re: svn commit: r221053 - head/usr.bin/rlogin
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 08:07:54 -0000


--XCIqNWEteo88hZlY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* David O'Brien , 20110427 21:35:
> One has to do all the various greps of the output in order to be
> confident of their belief of the results.

I usually run this afterwards:

	tail -n 3 _.* | less

Or something like this to simply give a list of failures:

	fgrep -L 'completed on' _.*

About bumping WARNS -- it's pretty hard to remove any WARNS-lines
without modifying the code. I think I added most of them by first
building all of world with WARNS=3D6 and selectively lowering them.

--=20
 Ed Schouten 
 WWW: http://80386.nl/

--XCIqNWEteo88hZlY
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iQIcBAEBAgAGBQJNuRwxAAoJEG5e2P40kaK7EIcQAI8VbjuW6kOsG9IeHfDOxeg+
ke9lu8dlL1Mr9s4eBfmPKc84m++fu8uQ9wPYVOz3BVevogC4+/zII0schOmo86yC
Zx2aJ56g2S3Fla4bJ+q1UrT/xUE9Dm53g1b9rUJkY1e1E6vxNMj0j3BkUb0USy1p
2gyv8zSHsmGBFEyLNlEU6vjzS7PxNCZgH4dga4ck8zPbABGVn7F6nNcbLRgdVwbR
LrSyxoZXdHMQMBZzoTMPintD23JXDuOruLxncPNNTah4OOLJs5IGDU6Qo6EpM3r/
gvuDW1xSXYIsxcjxrUA8g70srOu8lWvQk9qrjZo7TwERuE7qzJT6kmHp6EWqElcf
pKQCx3m7EG6WQnXErcD5aOaPIX5nFxxpoeK8igyBehpOoTnFwqGvqhDagCWVff01
ky/ExdrhZkLZWVN0yfLxcgmr6E8amPUQ1QDzkiGgDYAPZu+HahsV9CvhTux5mq6e
tMton86t00KR71JAyHUaPzVK97Vld2rdW0zKWhqlJvk2Sa7y13DRgpE+w6qBf6K6
zB3hLLWE7HSL/Jg4DqshwQhmZZ1vM55uXsNFrgW9GWDSllsmKYs0cbho1cAc/J8i
cemcyu0ztrmeWcTaZ5PacqnGsuafOybcrAqGteQe6CIRUupRphDRVlPW0U6hHrUf
mSbSRMfcZTYYcI6or/kB
=0LzI
-----END PGP SIGNATURE-----

--XCIqNWEteo88hZlY--

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 11:13:26 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7CEF0106564A;
	Thu, 28 Apr 2011 11:13:26 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4F1CA8FC14;
	Thu, 28 Apr 2011 11:13:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SBDQ9m020380;
	Thu, 28 Apr 2011 11:13:26 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SBDQdR020376;
	Thu, 28 Apr 2011 11:13:26 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104281113.p3SBDQdR020376@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 28 Apr 2011 11:13:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221160 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 11:13:26 -0000

Author: adrian
Date: Thu Apr 28 11:13:26 2011
New Revision: 221160
URL: http://svn.freebsd.org/changeset/base/221160

Log:
  Add the IP2 DDR flush handlers.
  
  These aren't yet used in the interrupt handler path but should be.

Modified:
  head/sys/mips/atheros/ar724x_chip.c
  head/sys/mips/atheros/ar724xreg.h
  head/sys/mips/atheros/ar91xx_chip.c

Modified: head/sys/mips/atheros/ar724x_chip.c
==============================================================================
--- head/sys/mips/atheros/ar724x_chip.c	Thu Apr 28 11:06:14 2011	(r221159)
+++ head/sys/mips/atheros/ar724x_chip.c	Thu Apr 28 11:13:26 2011	(r221160)
@@ -146,6 +146,13 @@ ar724x_chip_ddr_flush_ge1(void)
 	ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_GE1);
 }
 
+static void
+ar724x_chip_ddr_flush_ip2(void)
+{
+	ar71xx_ddr_flush(AR724X_DDR_REG_FLUSH_PCIE);
+}
+
+
 static uint32_t
 ar724x_chip_get_eth_pll(unsigned int mac, int speed)
 {
@@ -207,6 +214,6 @@ struct ar71xx_cpu_def ar724x_chip_def = 
         &ar724x_chip_ddr_flush_ge0,
         &ar724x_chip_ddr_flush_ge1,
         &ar724x_chip_get_eth_pll,
-	NULL,		/* ar71xx_chip_irq_flush_ip2 */
+        &ar724x_chip_ddr_flush_ip2,
 	&ar724x_chip_init_usb_peripheral
 };

Modified: head/sys/mips/atheros/ar724xreg.h
==============================================================================
--- head/sys/mips/atheros/ar724xreg.h	Thu Apr 28 11:06:14 2011	(r221159)
+++ head/sys/mips/atheros/ar724xreg.h	Thu Apr 28 11:13:26 2011	(r221160)
@@ -59,6 +59,7 @@
 #define	AR7240_OHCI_BASE		0x1b000000
 #define	AR7240_OHCI_SIZE		0x01000000
 #define	AR724X_DDR_REG_FLUSH_USB	(AR71XX_DDR_CONFIG + 0x84)
+#define	AR724X_DDR_REG_FLUSH_PCIE	(AR71XX_DDR_CONFIG + 0x88)
 
 #define	AR724X_PCI_CRP_BASE		(AR71XX_APB_BASE + 0x000C0000)
 #define	AR724X_PCI_CRP_SIZE		0x100

Modified: head/sys/mips/atheros/ar91xx_chip.c
==============================================================================
--- head/sys/mips/atheros/ar91xx_chip.c	Thu Apr 28 11:06:14 2011	(r221159)
+++ head/sys/mips/atheros/ar91xx_chip.c	Thu Apr 28 11:13:26 2011	(r221160)
@@ -174,6 +174,13 @@ ar91xx_chip_ddr_flush_ge1(void)
 	ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE1);
 }
 
+static void
+ar91xx_chip_ddr_flush_ip2(void)
+{
+	ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_WMAC);
+}
+
+
 static uint32_t
 ar91xx_chip_get_eth_pll(unsigned int mac, int speed)
 {
@@ -211,6 +218,6 @@ struct ar71xx_cpu_def ar91xx_chip_def = 
         &ar91xx_chip_ddr_flush_ge0,
         &ar91xx_chip_ddr_flush_ge1,
         &ar91xx_chip_get_eth_pll,
-	NULL,
+        &ar91xx_chip_ddr_flush_ip2,
 	&ar91xx_chip_init_usb_peripheral,
 };

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 11:21:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F83E106564A;
	Thu, 28 Apr 2011 11:21:50 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 01F328FC12;
	Thu, 28 Apr 2011 11:21:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SBLnXm020671;
	Thu, 28 Apr 2011 11:21:49 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SBLnnQ020670;
	Thu, 28 Apr 2011 11:21:49 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104281121.p3SBLnnQ020670@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 28 Apr 2011 11:21:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221161 - head/tools/build/options
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 11:21:50 -0000

Author: des
Date: Thu Apr 28 11:21:49 2011
New Revision: 221161
URL: http://svn.freebsd.org/changeset/base/221161

Log:
  executable

Modified:
Directory Properties:
  head/tools/build/options/makeman   (props changed)

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 12:47:40 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B50F1106566C;
	Thu, 28 Apr 2011 12:47:40 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F2428FC0A;
	Thu, 28 Apr 2011 12:47:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SCle5J023559;
	Thu, 28 Apr 2011 12:47:40 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SCle5T023546;
	Thu, 28 Apr 2011 12:47:40 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104281247.p3SCle5T023546@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 28 Apr 2011 12:47:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221163 - in head/sys: conf dev/ath dev/ath/ath_hal
	dev/ath/ath_hal/ar5416 dev/ath/ath_hal/ar9001 modules/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 12:47:40 -0000

Author: adrian
Date: Thu Apr 28 12:47:40 2011
New Revision: 221163
URL: http://svn.freebsd.org/changeset/base/221163

Log:
  Introduce AR9130 (HOWL) WMAC support to the FreeBSD HAL.
  
  The AR9130 is an AR9160/AR5416 family WMAC which is glued directly
  to the AR913x SoC peripheral bus (APB) rather than via a PCI/PCIe
  bridge.
  
  The specifics:
  
  * A new build option is required to use the AR9130 - AH_SUPPORT_AR9130.
    This is needed due to the different location the RTC registers live
    with this chip; hopefully this will be undone in the future.
    This does currently mean that enabling this option will break non-AR9130
    builds, so don't enable it unless you're specifically building an image
    for the AR913x SoC.
  
  * Add the new probe, attach, EEPROM and PLL methods specific to Howl.
  
  * Add a work-around to ah_eeprom_v14.c which disables some of the checks
    for endian-ness and magic in the EEPROM image if an eepromdata block
    is provided. This'll be fixed at a later stage by porting the ath9k
    probe code and making sure it doesn't break in other setups (which
    my previous attempt at this did.)
  
  * Sprinkle Howl modifications throughput the interrupt path - it doesn't
    implement the SYNC interrupt registers, so ignore those.
  
  * Sprinkle Howl chip powerup/down throughout the reset path; the RTC methods
    were
  
  * Sprinkle some other Howl workarounds in the reset path.
  
  * Hard-code an alternative setup for the AR_CFG register for Howl, that
    sets up things suitable for Big-Endian MIPS (which is the only platform
    this chip is glued to.)
  
  This has been tested on the AR913x based TP-Link WR-1043nd mode, in
  legacy, HT/20 and HT/40 modes.
  
  Caveats:
  
  * 2ghz has only been tested. I've not seen any 5ghz radios glued to this
    chipset so I can't test it.
  
  * AR5416_INTERRUPT_MITIGATION is not supported on the AR9130. At least,
    it isn't implemented in ath9k. Please don't enable this.
  
  * This hasn't been tested in MBSS mode or in RX/TX block-aggregation mode.

Added:
  head/sys/dev/ath/ath_hal/ar9001/ar9130.ini   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.c   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9001/ar9130_eeprom.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.h   (contents, props changed)
  head/sys/dev/ath/ath_hal/ar9001/ar9130reg.h   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/dev/ath/ath_hal/ah.c
  head/sys/dev/ath/ath_hal/ah_devid.h
  head/sys/dev/ath/ath_hal/ah_eeprom_v14.c
  head/sys/dev/ath/ath_hal/ar5416/ar2133.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
  head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  head/sys/dev/ath/if_ath_ahb.c
  head/sys/modules/ath/Makefile

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/conf/files	Thu Apr 28 12:47:40 2011	(r221163)
@@ -757,6 +757,14 @@ dev/ath/ath_hal/ar5416/ar5416_reset.c \
 dev/ath/ath_hal/ar5416/ar5416_xmit.c \
 	optional ath_hal | ath_ar5416 | ath_ar9160 | ath_ar9280 | ath_ar9285 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+# ar9130 (depends upon ar5416) - also requires AH_SUPPORT_AR9130
+dev/ath/ath_hal/ar9001/ar9130_attach.c optional ath_hal | ath_ar9130 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9001/ar9130_phy.c optional ath_hal | ath_ar9130 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+dev/ath/ath_hal/ar9001/ar9130_eeprom.c optional ath_hal | ath_ar9130 \
+	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"
+
 # ar9160 (depends on ar5416)
 dev/ath/ath_hal/ar9001/ar9160_attach.c optional ath_hal | ath_ar9160 \
 	compile-with "${NORMAL_C} -I$S/dev/ath -I$S/dev/ath/ath_hal"

Modified: head/sys/dev/ath/ath_hal/ah.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ah.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -109,6 +109,8 @@ ath_hal_mac_name(struct ath_hal *ah)
 		return "5416";
 	case AR_XSREV_VERSION_OWL_PCIE:
 		return "5418";
+	case AR_XSREV_VERSION_HOWL:
+		return "9130";
 	case AR_XSREV_VERSION_SOWL:
 		return "9160";
 	case AR_XSREV_VERSION_MERLIN:

Modified: head/sys/dev/ath/ath_hal/ah_devid.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_devid.h	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ah_devid.h	Thu Apr 28 12:47:40 2011	(r221163)
@@ -74,6 +74,7 @@
 /* AR5416 compatible devid's  */
 #define AR5416_DEVID_PCI	0x0023          /* AR5416 PCI (MB/CB) Owl */
 #define AR5416_DEVID_PCIE	0x0024          /* AR5416 PCI-E (XB) Owl */
+#define	AR5416_AR9130_DEVID     0x000b          /* AR9130 SoC WiMAC */
 #define AR9160_DEVID_PCI	0x0027          /* AR9160 PCI Sowl */
 #define AR9280_DEVID_PCI	0x0029          /* AR9280 PCI Merlin */
 #define AR9280_DEVID_PCIE	0x002a          /* AR9280 PCI-E Merlin */

Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v14.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ah_eeprom_v14.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ah_eeprom_v14.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -316,6 +316,11 @@ v14EepromDetach(struct ath_hal *ah)
 #define owl_get_eep_rev(_ee)   \
     (((_ee)->ee_base.baseEepHeader.version) & 0xFFF)
 
+/*
+ * Howl is (hopefully) a special case where the endian-ness of the EEPROM
+ * matches the native endian-ness; and that supplied EEPROMs don't have
+ * a magic value to check.
+ */
 HAL_STATUS
 ath_hal_v14EepromAttach(struct ath_hal *ah)
 {
@@ -328,16 +333,23 @@ ath_hal_v14EepromAttach(struct ath_hal *
 
 	HALASSERT(ee == AH_NULL);
  
-	if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
-		HALDEBUG(ah, HAL_DEBUG_ANY,
-		    "%s Error reading Eeprom MAGIC\n", __func__);
-		return HAL_EEREAD;
-	}
-	HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n",
-	    __func__, magic);
-	if (magic != AR5416_EEPROM_MAGIC) {
-		HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n");
-		return HAL_EEMAGIC;
+	/*
+	 * Don't check magic if we're supplied with an EEPROM block,
+	 * typically this is from Howl but it may also be from later
+	 * boards w/ an embedded Merlin.
+	 */
+	if (ah->ah_eepromdata == NULL) {
+		if (!ath_hal_eepromRead(ah, AR5416_EEPROM_MAGIC_OFFSET, &magic)) {
+			HALDEBUG(ah, HAL_DEBUG_ANY,
+			    "%s Error reading Eeprom MAGIC\n", __func__);
+			return HAL_EEREAD;
+		}
+		HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s Eeprom Magic = 0x%x\n",
+		    __func__, magic);
+		if (magic != AR5416_EEPROM_MAGIC) {
+			HALDEBUG(ah, HAL_DEBUG_ANY, "Bad magic number\n");
+			return HAL_EEMAGIC;
+		}
 	}
 
 	ee = ath_hal_malloc(sizeof(HAL_EEPROM_v14));
@@ -357,7 +369,8 @@ ath_hal_v14EepromAttach(struct ath_hal *
 		}
 	}
 	/* Convert to eeprom native eeprom endian format */
-	if (isBigEndian()) {
+	/* XXX this is likely incorrect but will do for now to get howl/ap83 working. */
+	if (ah->ah_eepromdata == NULL && isBigEndian()) {
 		for (w = 0; w < NW(struct ar5416eeprom); w++)
 			eep_data[w] = __bswap16(eep_data[w]);
 	}

Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar2133.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -171,7 +171,7 @@ ar2133SetChannel(struct ath_hal *ah, con
 			aModeRefSel = ath_hal_reverseBits(1, 2);
 	} else if ((freq % 10) == 0) {
 		channelSel = ath_hal_reverseBits(((freq - 4800) / 10 << 1), 8);
-		if (AR_SREV_SOWL_10_OR_LATER(ah))
+		if (AR_SREV_HOWL(ah) || AR_SREV_SOWL_10_OR_LATER(ah))
 			aModeRefSel = ath_hal_reverseBits(2, 2);
 		else
 			aModeRefSel = ath_hal_reverseBits(1, 2);

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -34,6 +34,10 @@ HAL_BOOL
 ar5416IsInterruptPending(struct ath_hal *ah)
 {
 	uint32_t isr;
+
+	if (AR_SREV_HOWL(ah))
+		return AH_TRUE;
+
 	/* 
 	 * Some platforms trigger our ISR before applying power to
 	 * the card, so make sure the INTPEND is really 1, not 0xffffffff.
@@ -63,22 +67,27 @@ ar5416IsInterruptPending(struct ath_hal 
 HAL_BOOL
 ar5416GetPendingInterrupts(struct ath_hal *ah, HAL_INT *masked)
 {
-	uint32_t isr, isr0, isr1, sync_cause;
+	uint32_t isr, isr0, isr1, sync_cause = 0;
 
 	/*
 	 * Verify there's a mac interrupt and the RTC is on.
 	 */
-	if ((OS_REG_READ(ah, AR_INTR_ASYNC_CAUSE) & AR_INTR_MAC_IRQ) &&
-	    (OS_REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M) == AR_RTC_STATUS_ON)
+	if (AR_SREV_HOWL(ah)) {
+		*masked = 0;
 		isr = OS_REG_READ(ah, AR_ISR);
-	else
-		isr = 0;
-	sync_cause = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
-	sync_cause &= AR_INTR_SYNC_DEFAULT;
-	*masked = 0;
+	} else {
+		if ((OS_REG_READ(ah, AR_INTR_ASYNC_CAUSE) & AR_INTR_MAC_IRQ) &&
+		    (OS_REG_READ(ah, AR_RTC_STATUS) & AR_RTC_STATUS_M) == AR_RTC_STATUS_ON)
+			isr = OS_REG_READ(ah, AR_ISR);
+		else
+			isr = 0;
+		sync_cause = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
+		sync_cause &= AR_INTR_SYNC_DEFAULT;
+		*masked = 0;
 
-	if (isr == 0 && sync_cause == 0)
-		return AH_FALSE;
+		if (isr == 0 && sync_cause == 0)
+			return AH_FALSE;
+	}
 
 	if (isr != 0) {
 		struct ath_hal_5212 *ahp = AH5212(ah);
@@ -138,6 +147,10 @@ ar5416GetPendingInterrupts(struct ath_ha
 #endif
 		*masked |= mask2;
 	}
+
+	if (AR_SREV_HOWL(ah))
+		return AH_TRUE;
+
 	if (sync_cause != 0) {
 		if (sync_cause & (AR_INTR_SYNC_HOST1_FATAL | AR_INTR_SYNC_HOST1_PERR)) {
 			*masked |= HAL_INT_FATAL;
@@ -186,11 +199,13 @@ ar5416SetInterrupts(struct ath_hal *ah, 
 		OS_REG_WRITE(ah, AR_IER, AR_IER_DISABLE);
 		(void) OS_REG_READ(ah, AR_IER);
 
-		OS_REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, 0);
-		(void) OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE);
+		if (! AR_SREV_HOWL(ah)) {
+			OS_REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, 0);
+			(void) OS_REG_READ(ah, AR_INTR_ASYNC_ENABLE);
 
-		OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0);
-		(void) OS_REG_READ(ah, AR_INTR_SYNC_ENABLE);
+			OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0);
+			(void) OS_REG_READ(ah, AR_INTR_SYNC_ENABLE);
+		}
 	}
 
 	mask = ints & HAL_INT_COMMON;
@@ -270,19 +285,21 @@ ar5416SetInterrupts(struct ath_hal *ah, 
 		HALDEBUG(ah, HAL_DEBUG_INTERRUPT, "%s: enable IER\n", __func__);
 		OS_REG_WRITE(ah, AR_IER, AR_IER_ENABLE);
 
-		mask = AR_INTR_MAC_IRQ;
-		if (ints & HAL_INT_GPIO)
-			mask |= SM(AH5416(ah)->ah_gpioMask,
-			    AR_INTR_ASYNC_MASK_GPIO);
-		OS_REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, mask);
-		OS_REG_WRITE(ah, AR_INTR_ASYNC_MASK, mask);
-
-		mask = AR_INTR_SYNC_DEFAULT;
-		if (ints & HAL_INT_GPIO)
-			mask |= SM(AH5416(ah)->ah_gpioMask,
-			    AR_INTR_SYNC_MASK_GPIO);
-		OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, mask);
-		OS_REG_WRITE(ah, AR_INTR_SYNC_MASK, mask);
+		if (! AR_SREV_HOWL(ah)) {
+			mask = AR_INTR_MAC_IRQ;
+			if (ints & HAL_INT_GPIO)
+				mask |= SM(AH5416(ah)->ah_gpioMask,
+				    AR_INTR_ASYNC_MASK_GPIO);
+			OS_REG_WRITE(ah, AR_INTR_ASYNC_ENABLE, mask);
+			OS_REG_WRITE(ah, AR_INTR_ASYNC_MASK, mask);
+
+			mask = AR_INTR_SYNC_DEFAULT;
+			if (ints & HAL_INT_GPIO)
+				mask |= SM(AH5416(ah)->ah_gpioMask,
+				    AR_INTR_SYNC_MASK_GPIO);
+			OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, mask);
+			OS_REG_WRITE(ah, AR_INTR_SYNC_MASK, mask);
+		}
 	}
 
 	return omask;

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -77,6 +77,9 @@ ar5416SetLedState(struct ath_hal *ah, HA
 	};
 	uint32_t bits;
 
+	if (AR_SREV_HOWL(ah))
+		return;
+
 	bits = OS_REG_READ(ah, AR_MAC_LED);
 	bits = (bits &~ AR_MAC_LED_MODE)
 	     | SM(AR_MAC_LED_MODE_POWON, AR_MAC_LED_MODE)

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_power.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -52,6 +52,9 @@ ar5416SetPowerModeAwake(struct ath_hal *
 				goto bad;			
 		}
 
+		if (AR_SREV_HOWL(ah))
+			OS_REG_SET_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
+
 		OS_REG_SET_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
 		OS_DELAY(50);   /* Give chip the chance to awake */
 
@@ -88,7 +91,8 @@ ar5416SetPowerModeSleep(struct ath_hal *
 	if (setChip) {
 		/* Clear the RTC force wake bit to allow the mac to sleep */
 		OS_REG_CLR_BIT(ah, AR_RTC_FORCE_WAKE, AR_RTC_FORCE_WAKE_EN);
-		OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
+		if (! AR_SREV_HOWL(ah))
+			OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
 		/* Shutdown chip. Active low */
 		OS_REG_CLR_BIT(ah, AR_RTC_RESET, AR_RTC_RESET_EN);
 	}

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Thu Apr 28 12:47:40 2011	(r221163)
@@ -145,7 +145,8 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 		 AR_MAC_LED_BLINK_THRESH_SEL | AR_MAC_LED_BLINK_SLOW);
 
 	/* For chips on which the RTC reset is done, save TSF before it gets cleared */
-	if (AR_SREV_MERLIN_20_OR_LATER(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL))
+	if (AR_SREV_HOWL(ah) ||
+	    (AR_SREV_MERLIN_20_OR_LATER(ah) && ath_hal_eepromGetFlag(ah, AR_EEP_OL_PWRCTRL)))
 		tsf = ar5212GetTsf64(ah);
 
 	/* Mark PHY as inactive; marked active in ar5416InitBB() */
@@ -184,6 +185,17 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 
 	OS_MARK(ah, AH_MARK_RESET_LINE, __LINE__);
 
+	/*
+	 * Some AR91xx SoC devices frequently fail to accept TSF writes
+	 * right after the chip reset. When that happens, write a new
+	 * value after the initvals have been applied, with an offset
+	 * based on measured time difference
+	 */
+	if (AR_SREV_HOWL(ah) && (ar5212GetTsf64(ah) < tsf)) {
+		tsf += 1500;
+		ar5212SetTsf64(ah, tsf);
+	}
+
 	HALDEBUG(ah, HAL_DEBUG_RESET, ">>>2 %s: AR_PHY_DAG_CTRLCCK=0x%x\n",
 		__func__, OS_REG_READ(ah,AR_PHY_DAG_CTRLCCK));
 	HALDEBUG(ah, HAL_DEBUG_RESET, ">>>2 %s: AR_PHY_ADC_CTL=0x%x\n",
@@ -548,14 +560,25 @@ ar5416InitIMR(struct ath_hal *ah, HAL_OP
                         | AR_IMR_BCNMISC;
 
 #ifdef	AH_AR5416_INTERRUPT_MITIGATION
-       	ahp->ah_maskReg |= AR_IMR_TXINTM | AR_IMR_RXINTM
+	ahp->ah_maskReg |= AR_IMR_TXINTM | AR_IMR_RXINTM
 			|  AR_IMR_TXMINTR | AR_IMR_RXMINTR;
 #else
-        ahp->ah_maskReg |= AR_IMR_TXOK | AR_IMR_RXOK;
+	ahp->ah_maskReg |= AR_IMR_TXOK | AR_IMR_RXOK;
 #endif	
+
 	if (opmode == HAL_M_HOSTAP)
 		ahp->ah_maskReg |= AR_IMR_MIB;
 	OS_REG_WRITE(ah, AR_IMR, ahp->ah_maskReg);
+
+#ifdef  ADRIAN_NOTYET
+	/* This is straight from ath9k */
+	if (! AR_SREV_HOWL(ah)) {
+		OS_REG_WRITE(ah, AR_INTR_SYNC_CAUSE, 0xFFFFFFFF);
+		OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, AR_INTR_SYNC_DEFAULT);
+		OS_REG_WRITE(ah, AR_INTR_SYNC_MASK, 0);
+	}
+#endif
+
 	/* Enable bus errors that are OR'd to set the HIUERR bit */
 #if 0
 	OS_REG_WRITE(ah, AR_IMR_S2, 
@@ -1136,10 +1159,13 @@ ar5416SetResetPowerOn(struct ath_hal *ah
     /*
      * RTC reset and clear
      */
-    OS_REG_WRITE(ah, AR_RC, AR_RC_AHB);
+    if (! AR_SREV_HOWL(ah))
+    	OS_REG_WRITE(ah, AR_RC, AR_RC_AHB);
     OS_REG_WRITE(ah, AR_RTC_RESET, 0);
     OS_DELAY(20);
-    OS_REG_WRITE(ah, AR_RC, 0);
+
+    if (! AR_SREV_HOWL(ah))
+    	OS_REG_WRITE(ah, AR_RC, 0);
 
     OS_REG_WRITE(ah, AR_RTC_RESET, 1);
 
@@ -1158,6 +1184,18 @@ static HAL_BOOL
 ar5416SetReset(struct ath_hal *ah, int type)
 {
     uint32_t tmpReg, mask;
+    uint32_t rst_flags;
+
+#ifdef	AH_SUPPORT_AR9130	/* Because of the AR9130 specific registers */
+    if (AR_SREV_HOWL(ah)) {
+        HALDEBUG(ah, HAL_DEBUG_ANY, "[ath] HOWL: Fiddling with derived clk!\n");
+        uint32_t val = OS_REG_READ(ah, AR_RTC_DERIVED_CLK);
+        val &= ~AR_RTC_DERIVED_CLK_PERIOD;
+        val |= SM(1, AR_RTC_DERIVED_CLK_PERIOD);
+        OS_REG_WRITE(ah, AR_RTC_DERIVED_CLK, val);
+        (void) OS_REG_READ(ah, AR_RTC_DERIVED_CLK);
+    }
+#endif	/* AH_SUPPORT_AR9130 */
 
     /*
      * Force wake
@@ -1165,31 +1203,31 @@ ar5416SetReset(struct ath_hal *ah, int t
     OS_REG_WRITE(ah, AR_RTC_FORCE_WAKE,
 	AR_RTC_FORCE_WAKE_EN | AR_RTC_FORCE_WAKE_ON_INT);
 
-    /*
-     * Reset AHB
-     */
-    tmpReg = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
-    if (tmpReg & (AR_INTR_SYNC_LOCAL_TIMEOUT|AR_INTR_SYNC_RADM_CPL_TIMEOUT)) {
-	OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0);
-	OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
+#ifdef	AH_SUPPORT_AR9130
+    if (AR_SREV_HOWL(ah)) {
+        rst_flags = AR_RTC_RC_MAC_WARM | AR_RTC_RC_MAC_COLD |
+          AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET;
     } else {
-	OS_REG_WRITE(ah, AR_RC, AR_RC_AHB);
+#endif	/* AH_SUPPORT_AR9130 */
+        /*
+         * Reset AHB
+         */
+        tmpReg = OS_REG_READ(ah, AR_INTR_SYNC_CAUSE);
+        if (tmpReg & (AR_INTR_SYNC_LOCAL_TIMEOUT|AR_INTR_SYNC_RADM_CPL_TIMEOUT)) {
+            OS_REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0);
+            OS_REG_WRITE(ah, AR_RC, AR_RC_AHB|AR_RC_HOSTIF);
+        } else {
+	    OS_REG_WRITE(ah, AR_RC, AR_RC_AHB);
+        }
+        rst_flags = AR_RTC_RC_MAC_WARM;
+        if (type == HAL_RESET_COLD)
+            rst_flags |= AR_RTC_RC_MAC_COLD;
+#ifdef	AH_SUPPORT_AR9130
     }
+#endif	/* AH_SUPPORT_AR9130 */
 
-    /*
-     * Set Mac(BB,Phy) Warm Reset
-     */
-    switch (type) {
-    case HAL_RESET_WARM:
-            OS_REG_WRITE(ah, AR_RTC_RC, AR_RTC_RC_MAC_WARM);
-            break;
-    case HAL_RESET_COLD:
-            OS_REG_WRITE(ah, AR_RTC_RC, AR_RTC_RC_MAC_WARM|AR_RTC_RC_MAC_COLD);
-            break;
-    default:
-            HALASSERT(AH_FALSE);
-            break;
-    }
+    OS_REG_WRITE(ah, AR_RTC_RC, rst_flags);
+    OS_DELAY(50);
 
     /*
      * Clear resets and force wakeup
@@ -1201,8 +1239,26 @@ ar5416SetReset(struct ath_hal *ah, int t
     }
 
     /* Clear AHB reset */
-    OS_REG_WRITE(ah, AR_RC, 0);
+    if (! AR_SREV_HOWL(ah))
+        OS_REG_WRITE(ah, AR_RC, 0);
+
+    if (AR_SREV_HOWL(ah))
+        OS_DELAY(50);
 
+    if (AR_SREV_HOWL(ah)) {
+                uint32_t mask;
+                mask = OS_REG_READ(ah, AR_CFG);
+                if (mask & (AR_CFG_SWRB | AR_CFG_SWTB | AR_CFG_SWRG)) {
+                        HALDEBUG(ah, HAL_DEBUG_RESET,
+                                "CFG Byte Swap Set 0x%x\n", mask);
+                } else {
+                        mask =  
+                                INIT_CONFIG_STATUS | AR_CFG_SWRB | AR_CFG_SWTB;
+                        OS_REG_WRITE(ah, AR_CFG, mask);
+                        HALDEBUG(ah, HAL_DEBUG_RESET,
+                                "Setting CFG 0x%x\n", OS_REG_READ(ah, AR_CFG));
+                }
+    } else {
 	if (type == HAL_RESET_COLD) {
 		if (isBigEndian()) {
 			/*
@@ -1219,6 +1275,7 @@ ar5416SetReset(struct ath_hal *ah, int t
 		} else
 			OS_REG_WRITE(ah, AR_CFG, INIT_CONFIG_STATUS);
 	}
+    }
 
     AH5416(ah)->ah_initPLL(ah, AH_NULL);
 
@@ -1235,6 +1292,11 @@ ar5416InitChainMasks(struct ath_hal *ah)
 	OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask);
 	OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask);
 	OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask);
+
+	if (AR_SREV_HOWL(ah)) {
+		OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP,
+		OS_REG_READ(ah, AR_PHY_ANALOG_SWAP) | 0x00000001);
+	}
 }
 
 void
@@ -2440,12 +2502,12 @@ ar5416OverrideIni(struct ath_hal *ah, co
 
 	/*
 	 * The AR5416 initvals have this already set to 0x11; AR9160 has
-	 * the register set to 0x0. Figure out whether AR9100/AR9160 needs
+	 * the register set to 0x0. Figure out whether AR9130/AR9160 needs
 	 * this before moving forward with it.
 	 */
 #if 0
-	/* Disable BB clock gating for AR5416v2, AR9100, AR9160 */
-        if (AR_SREV_OWL_20_OR_LATER(ah) || AR_SREV_9100(ah) || AR_SREV_SOWL(ah)) {
+	/* Disable BB clock gating for AR5416v2, AR9130, AR9160 */
+        if (AR_SREV_OWL_20_OR_LATER(ah) || AR_SREV_HOWL(ah) || AR_SREV_SOWL(ah)) {
 		/*
 		 * Disable BB clock gating
 		 * Necessary to avoid issues on AR5416 2.0
@@ -2458,7 +2520,7 @@ ar5416OverrideIni(struct ath_hal *ah, co
 	 * Disable RIFS search on some chips to avoid baseband
 	 * hang issues.
 	 */
-	if (AR_SREV_9100(ah) || AR_SREV_SOWL(ah)) {
+	if (AR_SREV_HOWL(ah) || AR_SREV_SOWL(ah)) {
 		val = OS_REG_READ(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS);
 		val &= ~AR_PHY_RIFS_INIT_DELAY;
 		OS_REG_WRITE(ah, AR_PHY_HEAVY_CLIP_FACTOR_RIFS, val);

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Thu Apr 28 12:39:31 2011	(r221162)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h	Thu Apr 28 12:47:40 2011	(r221163)
@@ -54,15 +54,30 @@
 #define	AR_GPIO_OUTPUT_MUX3	0x4068
 #define	AR_EEPROM_STATUS_DATA	0x407c
 #define	AR_OBS			0x4080
-#define	AR_RTC_RC		0x7000	/* reset control */
-#define	AR_RTC_PLL_CONTROL	0x7014
-#define	AR_RTC_RESET		0x7040	/* RTC reset register */
-#define	AR_RTC_STATUS		0x7044	/* system sleep status */
-#define	AR_RTC_SLEEP_CLK	0x7048
-#define	AR_RTC_FORCE_WAKE	0x704c	/* control MAC force wake */
-#define	AR_RTC_INTR_CAUSE	0x7050	/* RTC interrupt cause/clear */
-#define	AR_RTC_INTR_ENABLE	0x7054	/* RTC interrupt enable */
-#define	AR_RTC_INTR_MASK	0x7058	/* RTC interrupt mask */
+
+#ifdef	AH_SUPPORT_AR9130
+#define	AR_RTC_BASE		0x20000
+#else
+#define	AR_RTC_BASE		0x7000
+#endif	/* AH_SUPPORT_AR9130 */
+
+#define	AR_RTC_RC		AR_RTC_BASE + 0x00	/* reset control */
+#define	AR_RTC_PLL_CONTROL	AR_RTC_BASE + 0x14
+#define	AR_RTC_RESET		AR_RTC_BASE + 0x40	/* RTC reset register */
+#define	AR_RTC_STATUS		AR_RTC_BASE + 0x44	/* system sleep status */
+#define	AR_RTC_SLEEP_CLK	AR_RTC_BASE + 0x48
+#define	AR_RTC_FORCE_WAKE	AR_RTC_BASE + 0x4c	/* control MAC force wake */
+#define	AR_RTC_INTR_CAUSE	AR_RTC_BASE + 0x50	/* RTC interrupt cause/clear */
+#define	AR_RTC_INTR_ENABLE	AR_RTC_BASE + 0x54	/* RTC interrupt enable */
+#define	AR_RTC_INTR_MASK	AR_RTC_BASE + 0x58	/* RTC interrupt mask */
+
+#ifdef	AH_SUPPORT_AR9130
+/* RTC_DERIVED_* - only for AR9130 */
+#define	AR_RTC_DERIVED_CLK		(AR_RTC_BASE + 0x0038)
+#define	AR_RTC_DERIVED_CLK_PERIOD	0x0000fffe
+#define	AR_RTC_DERIVED_CLK_PERIOD_S	1
+#endif	/* AH_SUPPORT_AR9130 */
+
 /* AR9280: rf long shift registers */
 #define	AR_AN_RF2G1_CH0         0x7810
 #define	AR_AN_RF5G1_CH0         0x7818
@@ -313,6 +328,10 @@
 #define	AR_RTC_RC_M		0x00000003
 #define	AR_RTC_RC_MAC_WARM	0x00000001
 #define	AR_RTC_RC_MAC_COLD	0x00000002
+#ifdef	AH_SUPPORT_AR9130
+#define AR_RTC_RC_COLD_RESET    0x00000004
+#define AR_RTC_RC_WARM_RESET    0x00000008
+#endif	/* AH_SUPPORT_AR9130 */
 #define	AR_RTC_PLL_DIV		0x0000001f
 #define	AR_RTC_PLL_DIV_S	0
 #define	AR_RTC_PLL_DIV2		0x00000020
@@ -328,7 +347,11 @@
 #define	AR_RTC_RESET_EN		0x00000001	/* Reset RTC bit */
 
 #define	AR_RTC_PM_STATUS_M	0x0000000f	/* Pwr Mgmt Status */
+#ifdef	AH_SUPPORT_AR9130
+#define	AR_RTC_STATUS_M		0x0000000f	/* RTC Status */
+#else
 #define	AR_RTC_STATUS_M		0x0000003f	/* RTC Status */
+#endif	/* AH_SUPPORT_AR9130 */
 #define	AR_RTC_STATUS_SHUTDOWN	0x00000001
 #define	AR_RTC_STATUS_ON	0x00000002
 #define	AR_RTC_STATUS_SLEEP	0x00000004
@@ -584,7 +607,7 @@
 #define	AR_XSREV_REVISION_OWL_20	1	/* Owl 2.0/2.1 */
 #define	AR_XSREV_REVISION_OWL_22	2	/* Owl 2.2 */
 #define	AR_XSREV_VERSION_HOWL		0x14	/* Howl (AR9130) */
-#define	AR_XSREV_VERSION_SOWL		0x40
+#define	AR_XSREV_VERSION_SOWL		0x40	/* Sowl (AR9160) */
 #define	AR_XSREV_REVISION_SOWL_10	0	/* Sowl 1.0 */
 #define	AR_XSREV_REVISION_SOWL_11	1	/* Sowl 1.1 */
 #define	AR_XSREV_VERSION_MERLIN		0x80	/* Merlin Version */
@@ -607,6 +630,10 @@
 	((AR_SREV_OWL(_ah) && AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_22) || \
 	AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_HOWL)
 
+#define AR_SREV_HOWL(_ah) \
+	(AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_HOWL)
+#define	AR_SREV_9100(_ah)	AR_SREV_HOWL(_ah)
+
 #define	AR_SREV_SOWL(_ah) \
 	(AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_SOWL)
 #define	AR_SREV_SOWL_10_OR_LATER(_ah) \
@@ -649,6 +676,5 @@
 /* Not yet implemented chips */
 #define	AR_SREV_9271(_ah)	0
 #define	AR_SREV_9287_11_OR_LATER(_ah)	0
-#define	AR_SREV_9100(_ah)	0
 
 #endif /* _DEV_ATH_AR5416REG_H */

Added: head/sys/dev/ath/ath_hal/ar9001/ar9130.ini
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ath/ath_hal/ar9001/ar9130.ini	Thu Apr 28 12:47:40 2011	(r221163)
@@ -0,0 +1,669 @@
+/*
+ * Copyright (c) 2010 Atheros Communications Inc.
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+static const uint32_t ar5416Modes_9100[][6] = {
+    { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
+    { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
+    { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
+    { 0x000010f0, 0x0000a000, 0x00014000, 0x00016000, 0x0000b000, 0x00014008 },
+    { 0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00, 0x06e006e0 },
+    { 0x0000801c, 0x128d93a7, 0x128d93cf, 0x12e013d7, 0x12e013ab, 0x098813cf },
+    { 0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810, 0x08f04810 },
+    { 0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a, 0x0000320a },
+    { 0x00009804, 0x00000300, 0x000003c4, 0x000003c4, 0x00000300, 0x00000303 },
+    { 0x00009820, 0x02020200, 0x02020200, 0x02020200, 0x02020200, 0x02020200 },
+    { 0x00009824, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
+    { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
+    { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
+    { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
+    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
+    { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
+    { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
+    { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
+    { 0x00009850, 0x6c48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6c48b0e2, 0x6c48b0e2 },
+    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
+    { 0x0000985c, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e, 0x31395d5e },
+    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
+    { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
+    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
+    { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
+    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
+    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
+    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d },
+    { 0x00009940, 0x00750604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
+    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
+    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
+    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
+    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
+    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
+    { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
+    { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
+    { 0x000099c8, 0x6af65329, 0x6af65329, 0x6af65329, 0x6af65329, 0x6af65329 },
+    { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
+    { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
+    { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+    { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+    { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
+    { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
+    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
+    { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
+    { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
+    { 0x0000a300, 0x18010000, 0x18010000, 0x18010000, 0x18010000, 0x18010000 },
+    { 0x0000a304, 0x30032602, 0x30032602, 0x2e032402, 0x2e032402, 0x2e032402 },
+    { 0x0000a308, 0x48073e06, 0x48073e06, 0x4a0a3c06, 0x4a0a3c06, 0x4a0a3c06 },
+    { 0x0000a30c, 0x560b4c0a, 0x560b4c0a, 0x621a540b, 0x621a540b, 0x621a540b },
+    { 0x0000a310, 0x641a600f, 0x641a600f, 0x764f6c1b, 0x764f6c1b, 0x764f6c1b },
+    { 0x0000a314, 0x7a4f6e1b, 0x7a4f6e1b, 0x845b7a5a, 0x845b7a5a, 0x845b7a5a },
+    { 0x0000a318, 0x8c5b7e5a, 0x8c5b7e5a, 0x950f8ccf, 0x950f8ccf, 0x950f8ccf },
+    { 0x0000a31c, 0x9d0f96cf, 0x9d0f96cf, 0xa5cf9b4f, 0xa5cf9b4f, 0xa5cf9b4f },
+    { 0x0000a320, 0xb51fa69f, 0xb51fa69f, 0xbddfaf1f, 0xbddfaf1f, 0xbddfaf1f },
+    { 0x0000a324, 0xcb3fbd07, 0xcb3fbcbf, 0xd1ffc93f, 0xd1ffc93f, 0xd1ffc93f },
+    { 0x0000a328, 0x0000d7bf, 0x0000d7bf, 0x00000000, 0x00000000, 0x00000000 },
+    { 0x0000a32c, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+    { 0x0000a330, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+    { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
+};
+
+static const uint32_t ar5416Common_9100[][2] = {
+    /* Addr      allmodes  */
+    { 0x0000000c, 0x00000000 },
+    { 0x00000030, 0x00020015 },
+    { 0x00000034, 0x00000005 },
+    { 0x00000040, 0x00000000 },
+    { 0x00000044, 0x00000008 },
+    { 0x00000048, 0x00000008 },
+    { 0x0000004c, 0x00000010 },
+    { 0x00000050, 0x00000000 },
+    { 0x00000054, 0x0000001f },
+    { 0x00000800, 0x00000000 },
+    { 0x00000804, 0x00000000 },
+    { 0x00000808, 0x00000000 },
+    { 0x0000080c, 0x00000000 },
+    { 0x00000810, 0x00000000 },
+    { 0x00000814, 0x00000000 },
+    { 0x00000818, 0x00000000 },
+    { 0x0000081c, 0x00000000 },
+    { 0x00000820, 0x00000000 },
+    { 0x00000824, 0x00000000 },
+    { 0x00001040, 0x002ffc0f },
+    { 0x00001044, 0x002ffc0f },
+    { 0x00001048, 0x002ffc0f },
+    { 0x0000104c, 0x002ffc0f },
+    { 0x00001050, 0x002ffc0f },
+    { 0x00001054, 0x002ffc0f },
+    { 0x00001058, 0x002ffc0f },
+    { 0x0000105c, 0x002ffc0f },
+    { 0x00001060, 0x002ffc0f },
+    { 0x00001064, 0x002ffc0f },
+    { 0x00001230, 0x00000000 },
+    { 0x00001270, 0x00000000 },
+    { 0x00001038, 0x00000000 },
+    { 0x00001078, 0x00000000 },
+    { 0x000010b8, 0x00000000 },
+    { 0x000010f8, 0x00000000 },
+    { 0x00001138, 0x00000000 },
+    { 0x00001178, 0x00000000 },
+    { 0x000011b8, 0x00000000 },
+    { 0x000011f8, 0x00000000 },
+    { 0x00001238, 0x00000000 },
+    { 0x00001278, 0x00000000 },
+    { 0x000012b8, 0x00000000 },
+    { 0x000012f8, 0x00000000 },
+    { 0x00001338, 0x00000000 },
+    { 0x00001378, 0x00000000 },
+    { 0x000013b8, 0x00000000 },
+    { 0x000013f8, 0x00000000 },
+    { 0x00001438, 0x00000000 },
+    { 0x00001478, 0x00000000 },
+    { 0x000014b8, 0x00000000 },
+    { 0x000014f8, 0x00000000 },
+    { 0x00001538, 0x00000000 },
+    { 0x00001578, 0x00000000 },
+    { 0x000015b8, 0x00000000 },
+    { 0x000015f8, 0x00000000 },
+    { 0x00001638, 0x00000000 },
+    { 0x00001678, 0x00000000 },
+    { 0x000016b8, 0x00000000 },
+    { 0x000016f8, 0x00000000 },
+    { 0x00001738, 0x00000000 },
+    { 0x00001778, 0x00000000 },
+    { 0x000017b8, 0x00000000 },
+    { 0x000017f8, 0x00000000 },
+    { 0x0000103c, 0x00000000 },
+    { 0x0000107c, 0x00000000 },
+    { 0x000010bc, 0x00000000 },
+    { 0x000010fc, 0x00000000 },
+    { 0x0000113c, 0x00000000 },
+    { 0x0000117c, 0x00000000 },
+    { 0x000011bc, 0x00000000 },
+    { 0x000011fc, 0x00000000 },
+    { 0x0000123c, 0x00000000 },
+    { 0x0000127c, 0x00000000 },
+    { 0x000012bc, 0x00000000 },
+    { 0x000012fc, 0x00000000 },
+    { 0x0000133c, 0x00000000 },
+    { 0x0000137c, 0x00000000 },
+    { 0x000013bc, 0x00000000 },
+    { 0x000013fc, 0x00000000 },
+    { 0x0000143c, 0x00000000 },
+    { 0x0000147c, 0x00000000 },
+    { 0x00020010, 0x00000003 },
+    { 0x00020038, 0x000004c2 },
+    { 0x00008004, 0x00000000 },
+    { 0x00008008, 0x00000000 },
+    { 0x0000800c, 0x00000000 },
+    { 0x00008018, 0x00000700 },
+    { 0x00008020, 0x00000000 },
+    { 0x00008038, 0x00000000 },
+    { 0x0000803c, 0x00000000 },
+    { 0x00008048, 0x40000000 },
+    { 0x00008054, 0x00004000 },
+    { 0x00008058, 0x00000000 },
+    { 0x0000805c, 0x000fc78f },
+    { 0x00008060, 0x0000000f },
+    { 0x00008064, 0x00000000 },
+    { 0x000080c0, 0x2a82301a },
+    { 0x000080c4, 0x05dc01e0 },
+    { 0x000080c8, 0x1f402710 },
+    { 0x000080cc, 0x01f40000 },
+    { 0x000080d0, 0x00001e00 },
+    { 0x000080d4, 0x00000000 },
+    { 0x000080d8, 0x00400000 },
+    { 0x000080e0, 0xffffffff },
+    { 0x000080e4, 0x0000ffff },
+    { 0x000080e8, 0x003f3f3f },
+    { 0x000080ec, 0x00000000 },
+    { 0x000080f0, 0x00000000 },
+    { 0x000080f4, 0x00000000 },
+    { 0x000080f8, 0x00000000 },
+    { 0x000080fc, 0x00020000 },
+    { 0x00008100, 0x00020000 },
+    { 0x00008104, 0x00000001 },
+    { 0x00008108, 0x00000052 },
+    { 0x0000810c, 0x00000000 },
+    { 0x00008110, 0x00000168 },
+    { 0x00008118, 0x000100aa },
+    { 0x0000811c, 0x00003210 },
+    { 0x00008120, 0x08f04800 },
+    { 0x00008124, 0x00000000 },
+    { 0x00008128, 0x00000000 },
+    { 0x0000812c, 0x00000000 },
+    { 0x00008130, 0x00000000 },
+    { 0x00008134, 0x00000000 },
+    { 0x00008138, 0x00000000 },
+    { 0x0000813c, 0x00000000 },
+    { 0x00008144, 0x00000000 },
+    { 0x00008168, 0x00000000 },
+    { 0x0000816c, 0x00000000 },
+    { 0x00008170, 0x32143320 },
+    { 0x00008174, 0xfaa4fa50 },
+    { 0x00008178, 0x00000100 },
+    { 0x0000817c, 0x00000000 },
+    { 0x000081c4, 0x00000000 },
+    { 0x000081d0, 0x00003210 },
+    { 0x000081ec, 0x00000000 },
+    { 0x000081f0, 0x00000000 },
+    { 0x000081f4, 0x00000000 },
+    { 0x000081f8, 0x00000000 },
+    { 0x000081fc, 0x00000000 },
+    { 0x00008200, 0x00000000 },
+    { 0x00008204, 0x00000000 },
+    { 0x00008208, 0x00000000 },
+    { 0x0000820c, 0x00000000 },
+    { 0x00008210, 0x00000000 },
+    { 0x00008214, 0x00000000 },
+    { 0x00008218, 0x00000000 },
+    { 0x0000821c, 0x00000000 },
+    { 0x00008220, 0x00000000 },
+    { 0x00008224, 0x00000000 },
+    { 0x00008228, 0x00000000 },
+    { 0x0000822c, 0x00000000 },
+    { 0x00008230, 0x00000000 },
+    { 0x00008234, 0x00000000 },
+    { 0x00008238, 0x00000000 },
+    { 0x0000823c, 0x00000000 },
+    { 0x00008240, 0x00100000 },
+    { 0x00008244, 0x0010f400 },
+    { 0x00008248, 0x00000100 },
+    { 0x0000824c, 0x0001e800 },
+    { 0x00008250, 0x00000000 },
+    { 0x00008254, 0x00000000 },
+    { 0x00008258, 0x00000000 },
+    { 0x0000825c, 0x400000ff },
+    { 0x00008260, 0x00080922 },
+    { 0x00008270, 0x00000000 },
+    { 0x00008274, 0x40000000 },
+    { 0x00008278, 0x003e4180 },
+    { 0x0000827c, 0x00000000 },
+    { 0x00008284, 0x0000002c },
+    { 0x00008288, 0x0000002c },
+    { 0x0000828c, 0x00000000 },
+    { 0x00008294, 0x00000000 },
+    { 0x00008298, 0x00000000 },
+    { 0x00008300, 0x00000000 },
+    { 0x00008304, 0x00000000 },
+    { 0x00008308, 0x00000000 },
+    { 0x0000830c, 0x00000000 },
+    { 0x00008310, 0x00000000 },
+    { 0x00008314, 0x00000000 },
+    { 0x00008318, 0x00000000 },
+    { 0x00008328, 0x00000000 },
+    { 0x0000832c, 0x00000007 },
+    { 0x00008330, 0x00000302 },
+    { 0x00008334, 0x00000e00 },
+    { 0x00008338, 0x00000000 },
+    { 0x0000833c, 0x00000000 },
+    { 0x00008340, 0x000107ff },
+    { 0x00009808, 0x00000000 },
+    { 0x0000980c, 0xad848e19 },
+    { 0x00009810, 0x7d14e000 },
+    { 0x00009814, 0x9c0a9f6b },
+    { 0x0000981c, 0x00000000 },
+    { 0x0000982c, 0x0000a000 },
+    { 0x00009830, 0x00000000 },
+    { 0x0000983c, 0x00200400 },
+    { 0x00009840, 0x206a01ae },
+    { 0x0000984c, 0x1284233c },
+    { 0x00009854, 0x00000859 },
+    { 0x00009900, 0x00000000 },
+    { 0x00009904, 0x00000000 },
+    { 0x00009908, 0x00000000 },
+    { 0x0000990c, 0x00000000 },
+    { 0x0000991c, 0x10000fff },
+    { 0x00009920, 0x05100000 },
+    { 0x0000a920, 0x05100000 },
+    { 0x0000b920, 0x05100000 },
+    { 0x00009928, 0x00000001 },
+    { 0x0000992c, 0x00000004 },
+    { 0x00009934, 0x1e1f2022 },
+    { 0x00009938, 0x0a0b0c0d },
+    { 0x0000993c, 0x00000000 },
+    { 0x00009948, 0x9280b212 },
+    { 0x0000994c, 0x00020028 },
+    { 0x0000c95c, 0x004b6a8e },
+    { 0x0000c968, 0x000003ce },
+    { 0x00009970, 0x190fb515 },
+    { 0x00009974, 0x00000000 },
+    { 0x00009978, 0x00000001 },
+    { 0x0000997c, 0x00000000 },
+    { 0x00009980, 0x00000000 },
+    { 0x00009984, 0x00000000 },
+    { 0x00009988, 0x00000000 },
+    { 0x0000998c, 0x00000000 },
+    { 0x00009990, 0x00000000 },
+    { 0x00009994, 0x00000000 },
+    { 0x00009998, 0x00000000 },
+    { 0x0000999c, 0x00000000 },
+    { 0x000099a0, 0x00000000 },
+    { 0x000099a4, 0x00000001 },
+    { 0x000099a8, 0x201fff00 },
+    { 0x000099ac, 0x006f0000 },
+    { 0x000099b0, 0x03051000 },
+    { 0x000099dc, 0x00000000 },
+    { 0x000099e0, 0x00000200 },
+    { 0x000099e4, 0xaaaaaaaa },
+    { 0x000099e8, 0x3c466478 },
+    { 0x000099ec, 0x0cc80caa },
+    { 0x000099fc, 0x00001042 },
+    { 0x00009b00, 0x00000000 },
+    { 0x00009b04, 0x00000001 },
+    { 0x00009b08, 0x00000002 },
+    { 0x00009b0c, 0x00000003 },
+    { 0x00009b10, 0x00000004 },
+    { 0x00009b14, 0x00000005 },
+    { 0x00009b18, 0x00000008 },
+    { 0x00009b1c, 0x00000009 },
+    { 0x00009b20, 0x0000000a },
+    { 0x00009b24, 0x0000000b },
+    { 0x00009b28, 0x0000000c },
+    { 0x00009b2c, 0x0000000d },
+    { 0x00009b30, 0x00000010 },
+    { 0x00009b34, 0x00000011 },
+    { 0x00009b38, 0x00000012 },
+    { 0x00009b3c, 0x00000013 },
+    { 0x00009b40, 0x00000014 },
+    { 0x00009b44, 0x00000015 },
+    { 0x00009b48, 0x00000018 },
+    { 0x00009b4c, 0x00000019 },
+    { 0x00009b50, 0x0000001a },
+    { 0x00009b54, 0x0000001b },
+    { 0x00009b58, 0x0000001c },
+    { 0x00009b5c, 0x0000001d },
+    { 0x00009b60, 0x00000020 },
+    { 0x00009b64, 0x00000021 },
+    { 0x00009b68, 0x00000022 },
+    { 0x00009b6c, 0x00000023 },
+    { 0x00009b70, 0x00000024 },
+    { 0x00009b74, 0x00000025 },
+    { 0x00009b78, 0x00000028 },
+    { 0x00009b7c, 0x00000029 },
+    { 0x00009b80, 0x0000002a },
+    { 0x00009b84, 0x0000002b },
+    { 0x00009b88, 0x0000002c },
+    { 0x00009b8c, 0x0000002d },
+    { 0x00009b90, 0x00000030 },
+    { 0x00009b94, 0x00000031 },
+    { 0x00009b98, 0x00000032 },
+    { 0x00009b9c, 0x00000033 },
+    { 0x00009ba0, 0x00000034 },
+    { 0x00009ba4, 0x00000035 },
+    { 0x00009ba8, 0x00000035 },
+    { 0x00009bac, 0x00000035 },
+    { 0x00009bb0, 0x00000035 },
+    { 0x00009bb4, 0x00000035 },
+    { 0x00009bb8, 0x00000035 },
+    { 0x00009bbc, 0x00000035 },
+    { 0x00009bc0, 0x00000035 },
+    { 0x00009bc4, 0x00000035 },
+    { 0x00009bc8, 0x00000035 },
+    { 0x00009bcc, 0x00000035 },
+    { 0x00009bd0, 0x00000035 },
+    { 0x00009bd4, 0x00000035 },
+    { 0x00009bd8, 0x00000035 },
+    { 0x00009bdc, 0x00000035 },
+    { 0x00009be0, 0x00000035 },
+    { 0x00009be4, 0x00000035 },
+    { 0x00009be8, 0x00000035 },
+    { 0x00009bec, 0x00000035 },
+    { 0x00009bf0, 0x00000035 },
+    { 0x00009bf4, 0x00000035 },
+    { 0x00009bf8, 0x00000010 },
+    { 0x00009bfc, 0x0000001a },
+    { 0x0000a210, 0x40806333 },
+    { 0x0000a214, 0x00106c10 },
+    { 0x0000a218, 0x009c4060 },
+    { 0x0000a220, 0x018830c6 },
+    { 0x0000a224, 0x00000400 },
+    { 0x0000a228, 0x001a0bb5 },
+    { 0x0000a22c, 0x00000000 },
+    { 0x0000a234, 0x20202020 },
+    { 0x0000a238, 0x20202020 },
+    { 0x0000a23c, 0x13c889af },
+    { 0x0000a240, 0x38490a20 },
+    { 0x0000a244, 0x00007bb6 },
+    { 0x0000a248, 0x0fff3ffc },
+    { 0x0000a24c, 0x00000001 },
+    { 0x0000a250, 0x0000e000 },
+    { 0x0000a254, 0x00000000 },
+    { 0x0000a258, 0x0cc75380 },
+    { 0x0000a25c, 0x0f0f0f01 },
+    { 0x0000a260, 0xdfa91f01 },
+    { 0x0000a268, 0x00000001 },
+    { 0x0000a26c, 0x0ebae9c6 },
+    { 0x0000b26c, 0x0ebae9c6 },
+    { 0x0000c26c, 0x0ebae9c6 },
+    { 0x0000d270, 0x00820820 },
+    { 0x0000a278, 0x1ce739ce },
+    { 0x0000a27c, 0x050701ce },
+    { 0x0000a338, 0x00000000 },
+    { 0x0000a33c, 0x00000000 },
+    { 0x0000a340, 0x00000000 },
+    { 0x0000a344, 0x00000000 },
+    { 0x0000a348, 0x3fffffff },
+    { 0x0000a34c, 0x3fffffff },
+    { 0x0000a350, 0x3fffffff },
+    { 0x0000a354, 0x0003ffff },
+    { 0x0000a358, 0x79a8aa33 },
+    { 0x0000d35c, 0x07ffffef },
+    { 0x0000d360, 0x0fffffe7 },

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 12:52:01 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD6B5106566C;
	Thu, 28 Apr 2011 12:52:01 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CA4E98FC0A;
	Thu, 28 Apr 2011 12:52:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SCq1xi023727;
	Thu, 28 Apr 2011 12:52:01 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SCq1vm023725;
	Thu, 28 Apr 2011 12:52:01 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104281252.p3SCq1vm023725@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 28 Apr 2011 12:52:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221164 - head/sys/mips/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 12:52:02 -0000

Author: adrian
Date: Thu Apr 28 12:52:01 2011
New Revision: 221164
URL: http://svn.freebsd.org/changeset/base/221164

Log:
  Re-enable the wireless build parameters for the AR9130 WMAC.
  
  * enable 11n
  * add ath_ahb so the AHB<->ath glue is linked in
  * disable descriptor order swapping, it isn't needed here
  * disable interrupt mitigation, it isn't supported here

Modified:
  head/sys/mips/conf/AR91XX_BASE

Modified: head/sys/mips/conf/AR91XX_BASE
==============================================================================
--- head/sys/mips/conf/AR91XX_BASE	Thu Apr 28 12:47:40 2011	(r221163)
+++ head/sys/mips/conf/AR91XX_BASE	Thu Apr 28 12:52:01 2011	(r221164)
@@ -49,24 +49,27 @@ options         UFS_DIRHASH             
 options		IEEE80211_DEBUG
 options		IEEE80211_SUPPORT_MESH
 options		IEEE80211_SUPPORT_TDMA
-#device		wlan            # 802.11 support
-#device		wlan_wep        # 802.11 WEP support
-#device		wlan_ccmp       # 802.11 CCMP support
-#device		wlan_tkip       # 802.11 TKIP support
-#device		wlan_xauth	# 802.11 hostap support
+device		wlan            # 802.11 support
+device		wlan_wep        # 802.11 WEP support
+device		wlan_ccmp       # 802.11 CCMP support
+device		wlan_tkip       # 802.11 TKIP support
+device		wlan_xauth	# 802.11 hostap support
 
 # This will come later -adrian
-#device		ath             # Atheros pci/cardbus NIC's
+device		ath             # Atheros pci/cardbus NIC's
+device		ath_rate_sample
+device		ath_ahb
 options 	ATH_DEBUG
 options		ATH_DIAGAPI
+option		ATH_ENABLE_11N
+
+device		ath_hal
+
 options		AH_DEBUG
-#device		ath_hal
 option		AH_SUPPORT_AR5416
-option		AH_RXCFG_SDMAMW_4BYTES  # See NOTES for details of this WAR
-option		AH_NEED_DESC_SWAP	# ?
-#device		ath_rate_sample
-#device		ath_ahb
-option		AH_AR5416_INTERRUPT_MITIGATION
+option		AH_SUPPORT_AR9130	# Makes other chipsets not function!
+# interrupt mitigation not possible on AR9130
+# option		AH_AR5416_INTERRUPT_MITIGATION
 
 device		mii
 device		arge

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 14:27:17 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4376106572F;
	Thu, 28 Apr 2011 14:27:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 911258FC12;
	Thu, 28 Apr 2011 14:27:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SERHfv026826;
	Thu, 28 Apr 2011 14:27:17 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SERHo1026817;
	Thu, 28 Apr 2011 14:27:17 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104281427.p3SERHo1026817@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Apr 2011 14:27:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221166 - in head/sys: fs/ext2fs modules/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 14:27:17 -0000

Author: jhb
Date: Thu Apr 28 14:27:17 2011
New Revision: 221166
URL: http://svn.freebsd.org/changeset/base/221166

Log:
  Sync with several changes in UFS/FFS:
  - 77115: Implement support for O_DIRECT.
  - 98425: Fix a performance issue introduced in 70131 that was causing
    reads before writes even when writing full blocks.
  - 98658: Rename the BALLOC flags from B_* to BA_* to avoid confusion with
    the struct buf B_ flags.
  - 100344: Merge the BA_ and IO_ flags so so that they may both be used in
    the same flags word. This merger is possible by assigning the IO_ flags
    to the low sixteen bits and the BA_ flags the high sixteen bits.
  - 105422: Fix a file-rewrite performance case.
  - 129545: Implement IO_INVAL in VOP_WRITE() by marking the buffer as
    "no cache".
  - Readd the DOINGASYNC() macro and use it to control asynchronous writes.
    Change i-node updates to honor DOINGASYNC() instead of always being
    synchronous.
  - Use a PRIV_VFS_RETAINSUGID check instead of checking cr_uid against 0
    directly when deciding whether or not to clear suid and sgid bits.
  
  Submitted by:	Pedro F. Giffuni  giffunip at yahoo

Modified:
  head/sys/fs/ext2fs/ext2_balloc.c
  head/sys/fs/ext2fs/ext2_extern.h
  head/sys/fs/ext2fs/ext2_inode.c
  head/sys/fs/ext2fs/ext2_lookup.c
  head/sys/fs/ext2fs/ext2_readwrite.c
  head/sys/fs/ext2fs/ext2_vnops.c
  head/sys/fs/ext2fs/inode.h
  head/sys/modules/ext2fs/Makefile

Modified: head/sys/fs/ext2fs/ext2_balloc.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_balloc.c	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/ext2_balloc.c	Thu Apr 28 14:27:17 2011	(r221166)
@@ -41,7 +41,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -143,7 +143,7 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl
 				return (error);
 			bp = getblk(vp, lbn, nsize, 0, 0, 0);
 			bp->b_blkno = fsbtodb(fs, newb);
-			if (flags & B_CLRBUF)
+			if (flags & BA_CLRBUF)
 				vfs_bio_clrbuf(bp);
 		}
 		ip->i_db[lbn] = dbtofsb(fs, bp->b_blkno);
@@ -235,7 +235,7 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl
 		 * If required, write synchronously, otherwise use
 		 * delayed write.
 		 */
-		if (flags & B_SYNC) {
+		if (flags & IO_SYNC) {
 			bwrite(bp);
 		} else {
 			if (bp->b_bufsize == fs->e2fs_bsize)
@@ -258,14 +258,14 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl
 		nb = newb;
 		nbp = getblk(vp, lbn, fs->e2fs_bsize, 0, 0, 0);
 		nbp->b_blkno = fsbtodb(fs, nb);
-		if (flags & B_CLRBUF)
+		if (flags & BA_CLRBUF)
 			vfs_bio_clrbuf(nbp);
 		bap[indirs[i].in_off] = nb;
 		/*
 		 * If required, write synchronously, otherwise use
 		 * delayed write.
 		 */
-		if (flags & B_SYNC) {
+		if (flags & IO_SYNC) {
 			bwrite(bp);
 		} else {
 		if (bp->b_bufsize == fs->e2fs_bsize)
@@ -276,8 +276,15 @@ ext2_balloc(ip, lbn, size, cred, bpp, fl
 		return (0);
 	}
 	brelse(bp);
-	if (flags & B_CLRBUF) {
-		error = bread(vp, lbn, (int)fs->e2fs_bsize, NOCRED, &nbp);
+	if (flags & BA_CLRBUF) {
+		int seqcount = (flags & BA_SEQMASK) >> BA_SEQSHIFT;
+		if (seqcount && (vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) {
+			error = cluster_read(vp, ip->i_size, lbn,
+			    (int)fs->e2fs_bsize, NOCRED,
+			    MAXBSIZE, seqcount, &nbp);
+		} else {
+			error = bread(vp, lbn, (int)fs->e2fs_bsize, NOCRED, &nbp);
+		}
 		if (error) {
 			brelse(nbp);
 			return (error);

Modified: head/sys/fs/ext2fs/ext2_extern.h
==============================================================================
--- head/sys/fs/ext2fs/ext2_extern.h	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/ext2_extern.h	Thu Apr 28 14:27:17 2011	(r221166)
@@ -81,11 +81,13 @@ int	ext2_checkpath(struct inode *, struc
 int	cg_has_sb(int i);
 int	ext2_inactive(struct vop_inactive_args *);
 
-/* Flags to low-level allocation routines. */
-#define B_CLRBUF	0x01	/* Request allocated buffer be cleared. */
-#define B_SYNC		0x02	/* Do all allocations synchronously. */
-#define B_METAONLY	0x04	/* Return indirect block buffer. */
-#define B_NOWAIT	0x08	/* do not sleep to await lock */
+/* Flags to low-level allocation routines.
+ * The low 16-bits are reserved for IO_ flags from vnode.h.
+ */
+#define	BA_CLRBUF	0x00010000	/* Clear invalid areas of buffer. */
+#define	BA_SEQMASK	0x7F000000	/* Bits holding seq heuristic. */
+#define	BA_SEQSHIFT	24
+#define	BA_SEQMAX	0x7F
 
 extern struct vop_vector ext2_vnodeops;
 extern struct vop_vector ext2_fifoops;

Modified: head/sys/fs/ext2fs/ext2_inode.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_inode.c	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/ext2_inode.c	Thu Apr 28 14:27:17 2011	(r221166)
@@ -92,7 +92,7 @@ ext2_update(vp, waitfor)
 	}
 	ext2_i2ei(ip, (struct ext2fs_dinode *)((char *)bp->b_data +
 	    EXT2_INODE_SIZE(fs) * ino_to_fsbo(fs, ip->i_number)));
-	if (waitfor && (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) == 0)
+	if (waitfor && !DOINGASYNC(vp))
 		return (bwrite(bp));
 	else {
 		bdwrite(bp);
@@ -125,7 +125,7 @@ ext2_truncate(vp, length, flags, cred, t
 	struct buf *bp;
 	int offset, size, level;
 	long count, nblocks, blocksreleased = 0;
-	int aflags, error, i, allerror;
+	int error, i, allerror;
 	off_t osize;
 
 	oip = VTOI(ovp);
@@ -164,10 +164,8 @@ ext2_truncate(vp, length, flags, cred, t
 		vnode_pager_setsize(ovp, length);
 		offset = blkoff(fs, length - 1);
 		lbn = lblkno(fs, length - 1);
-		aflags = B_CLRBUF;
-		if (flags & IO_SYNC)
-			aflags |= B_SYNC;
-		error = ext2_balloc(oip, lbn, offset + 1, cred, &bp, aflags);
+		flags |= BA_CLRBUF;
+		error = ext2_balloc(oip, lbn, offset + 1, cred, &bp, flags);
 		if (error) {
 			vnode_pager_setsize(vp, osize);
 			return (error);
@@ -175,9 +173,9 @@ ext2_truncate(vp, length, flags, cred, t
 		oip->i_size = length;
 		if (bp->b_bufsize == fs->e2fs_bsize)
 			bp->b_flags |= B_CLUSTEROK;
-		if (aflags & B_SYNC)
+		if (flags & IO_SYNC)
 			bwrite(bp);
-		else if (ovp->v_mount->mnt_flag & MNT_ASYNC)
+		else if (DOINGASYNC(ovp))
 			bdwrite(bp);
 		else
 			bawrite(bp);
@@ -197,10 +195,8 @@ ext2_truncate(vp, length, flags, cred, t
 		oip->i_size = length;
 	} else {
 		lbn = lblkno(fs, length);
-		aflags = B_CLRBUF;
-		if (flags & IO_SYNC)
-			aflags |= B_SYNC;
-		error = ext2_balloc(oip, lbn, offset, cred, &bp, aflags);
+		flags |= BA_CLRBUF;
+		error = ext2_balloc(oip, lbn, offset, cred, &bp, flags);
 		if (error)
 			return (error);
 		oip->i_size = length;
@@ -209,9 +205,9 @@ ext2_truncate(vp, length, flags, cred, t
 		allocbuf(bp, size);
 		if (bp->b_bufsize == fs->e2fs_bsize)
 			bp->b_flags |= B_CLUSTEROK;
-		if (aflags & B_SYNC)
+		if (flags & IO_SYNC)
 			bwrite(bp);
-		else if (ovp->v_mount->mnt_flag & MNT_ASYNC)
+		else if (DOINGASYNC(ovp))
 			bdwrite(bp);
 		else
 			bawrite(bp);

Modified: head/sys/fs/ext2fs/ext2_lookup.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_lookup.c	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/ext2_lookup.c	Thu Apr 28 14:27:17 2011	(r221166)
@@ -890,7 +890,12 @@ ext2_direnter(ip, dvp, cnp)
 		ep = (struct ext2fs_direct_2 *)((char *)ep + dsize);
 	}
 	bcopy((caddr_t)&newdir, (caddr_t)ep, (u_int)newentrysize);
-	error = bwrite(bp);
+	if (DOINGASYNC(dvp)) {
+		bdwrite(bp);
+		error = 0;
+	} else {
+		error = bwrite(bp);
+	}
 	dp->i_flag |= IN_CHANGE | IN_UPDATE;
 	if (!error && dp->i_endoff && dp->i_endoff < dp->i_size)
 		error = ext2_truncate(dvp, (off_t)dp->i_endoff, IO_SYNC,
@@ -947,7 +952,10 @@ ext2_dirremove(dvp, cnp)
 	else
 		rep = (struct ext2fs_direct_2 *)((char *)ep + ep->e2d_reclen);
 	ep->e2d_reclen += rep->e2d_reclen;
-	error = bwrite(bp);
+	if (DOINGASYNC(dvp) && dp->i_count != 0)
+		bdwrite(bp);
+	else
+		error = bwrite(bp);
 	dp->i_flag |= IN_CHANGE | IN_UPDATE;
 	return (error);
 }

Modified: head/sys/fs/ext2fs/ext2_readwrite.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_readwrite.c	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/ext2_readwrite.c	Thu Apr 28 14:27:17 2011	(r221166)
@@ -45,6 +45,15 @@
 #define	WRITE			ext2_write
 #define	WRITE_S			"ext2_write"
 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "opt_directio.h"
+
 /*
  * Vnode op for reading.
  */
@@ -66,15 +75,16 @@ READ(ap)
 	off_t bytesinfile;
 	long size, xfersize, blkoffset;
 	int error, orig_resid, seqcount;
-	seqcount = ap->a_ioflag >> IO_SEQSHIFT;
-	u_short mode;
+	int ioflag;
 
 	vp = ap->a_vp;
-	ip = VTOI(vp);
-	mode = ip->i_mode;
 	uio = ap->a_uio;
+	ioflag = ap->a_ioflag;
 
-#ifdef DIAGNOSTIC
+	seqcount = ap->a_ioflag >> IO_SEQSHIFT;
+	ip = VTOI(vp);
+
+#ifdef INVARIANTS
 	if (uio->uio_rw != UIO_READ)
 		panic("%s: mode", READ_S);
 
@@ -90,8 +100,10 @@ READ(ap)
 		return (0);
 	KASSERT(uio->uio_offset >= 0, ("ext2_read: uio->uio_offset < 0"));
 	fs = ip->I_FS;
-	if (uio->uio_offset < ip->i_size && uio->uio_offset >= fs->e2fs_maxfilesize)
-		return (EOVERFLOW);
+	if (uio->uio_offset < ip->i_size &&
+	    uio->uio_offset >= fs->e2fs_maxfilesize)
+	    	return (EOVERFLOW);
+
 	for (error = 0, bp = NULL; uio->uio_resid > 0; bp = NULL) {
 		if ((bytesinfile = ip->i_size - uio->uio_offset) <= 0)
 			break;
@@ -109,8 +121,8 @@ READ(ap)
 		if (lblktosize(fs, nextlbn) >= ip->i_size)
 			error = bread(vp, lbn, size, NOCRED, &bp);
 		else if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0)
-		error = cluster_read(vp, ip->i_size, lbn, size,
-  			NOCRED, blkoffset + uio->uio_resid, seqcount, &bp);
+			error = cluster_read(vp, ip->i_size, lbn, size,
+			    NOCRED, blkoffset + uio->uio_resid, seqcount, &bp);
 		else if (seqcount > 1) {
 			int nextsize = BLKSIZE(fs, ip, nextlbn);
 			error = breadn(vp, lbn,
@@ -124,6 +136,15 @@ READ(ap)
 		}
 
 		/*
+		 * If IO_DIRECT then set B_DIRECT for the buffer.  This
+		 * will cause us to attempt to release the buffer later on
+		 * and will cause the buffer cache to attempt to free the
+		 * underlying pages.
+		 */
+		if (ioflag & IO_DIRECT)
+			bp->b_flags |= B_DIRECT;
+
+		/*
 		 * We should only get non-zero b_resid when an I/O error
 		 * has occurred, which should cause us to break above.
 		 * However, if the short read did not cause an error,
@@ -141,10 +162,42 @@ READ(ap)
 		if (error)
 			break;
 
-		bqrelse(bp);
+		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
+		   (LIST_FIRST(&bp->b_dep) == NULL)) {
+			/*
+			 * If there are no dependencies, and it's VMIO,
+			 * then we don't need the buf, mark it available
+			 * for freeing. The VM has the data.
+			 */
+			bp->b_flags |= B_RELBUF;
+			brelse(bp);
+		} else {
+			/*
+			 * Otherwise let whoever
+			 * made the request take care of
+			 * freeing it. We just queue
+			 * it onto another list.
+			 */
+			bqrelse(bp);
+		}
+	}
+
+	/* 
+	 * This can only happen in the case of an error
+	 * because the loop above resets bp to NULL on each iteration
+	 * and on normal completion has not set a new value into it.
+	 * so it must have come from a 'break' statement
+	 */
+	if (bp != NULL) {
+		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
+		   (LIST_FIRST(&bp->b_dep) == NULL)) {
+			bp->b_flags |= B_RELBUF;
+			brelse(bp);
+		} else {
+			bqrelse(bp);
+		}
 	}
-	if (bp != NULL)
-		bqrelse(bp);
+
 	if ((error == 0 || uio->uio_resid != orig_resid) &&
 	    (vp->v_mount->mnt_flag & MNT_NOATIME) == 0)
 		ip->i_flag |= IN_ACCESS;
@@ -173,12 +226,13 @@ WRITE(ap)
 	int blkoffset, error, flags, ioflag, resid, size, seqcount, xfersize;
 
 	ioflag = ap->a_ioflag;
-	seqcount = ioflag >> IO_SEQSHIFT;
 	uio = ap->a_uio;
 	vp = ap->a_vp;
+
+	seqcount = ioflag >> IO_SEQSHIFT;
 	ip = VTOI(vp);
 
-#ifdef DIAGNOSTIC
+#ifdef INVARIANTS
 	if (uio->uio_rw != UIO_WRITE)
 		panic("%s: mode", WRITE_S);
 #endif
@@ -217,7 +271,12 @@ WRITE(ap)
 
 	resid = uio->uio_resid;
 	osize = ip->i_size;
-	flags = ioflag & IO_SYNC ? B_SYNC : 0;
+	if (seqcount > BA_SEQMAX)
+		flags = BA_SEQMAX << BA_SEQSHIFT;
+	else
+		flags = seqcount << BA_SEQSHIFT;
+	if ((ioflag & IO_SYNC) && !DOINGASYNC(vp))
+		flags |= IO_SYNC;
 
 	for (error = 0; uio->uio_resid > 0;) {
 		lbn = lblkno(fs, uio->uio_offset);
@@ -228,17 +287,30 @@ WRITE(ap)
 		if (uio->uio_offset + xfersize > ip->i_size)
 			vnode_pager_setsize(vp, uio->uio_offset + xfersize);
 
-		/*
-		 * Avoid a data-consistency race between write() and mmap()
-		 * by ensuring that newly allocated blocks are zeroed. The
-		 * race can occur even in the case where the write covers
-		 * the entire block.
-		 */
-		flags |= B_CLRBUF;
+                /*
+		 * We must perform a read-before-write if the transfer size
+		 * does not cover the entire buffer.
+                 */
+		if (fs->e2fs_bsize > xfersize)
+			flags |= BA_CLRBUF;
+		else
+			flags &= ~BA_CLRBUF;
 		error = ext2_balloc(ip, lbn, blkoffset + xfersize,
-			ap->a_cred, &bp, flags);
+		    ap->a_cred, &bp, flags);
 		if (error != 0)
 			break;
+
+		/*
+		 * If the buffer is not valid and we did not clear garbage
+		 * out above, we have to do so here even though the write
+		 * covers the entire buffer in order to avoid a mmap()/write
+		 * race where another process may see the garbage prior to
+		 * the uiomove() for a write replacing it.
+		 */
+		if ((bp->b_flags & B_CACHE) == 0 && fs->e2fs_bsize <= xfersize)
+			vfs_bio_clrbuf(bp);
+		if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL))
+			bp->b_flags |= B_NOCACHE;
 		if (uio->uio_offset + xfersize > ip->i_size)
 			ip->i_size = uio->uio_offset + xfersize;
 		size = BLKSIZE(fs, ip, lbn) - bp->b_resid;
@@ -247,12 +319,25 @@ WRITE(ap)
 
 		error =
 		    uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
-		if ((ioflag & IO_VMIO) &&
-		   LIST_FIRST(&bp->b_dep) == NULL) /* in ext2fs? */
+		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
+		   (LIST_EMPTY(&bp->b_dep))) {	/* in ext2fs? */
 			bp->b_flags |= B_RELBUF;
+		}
 
+		/*
+		 * If IO_SYNC each buffer is written synchronously.  Otherwise
+		 * if we have a severe page deficiency write the buffer
+		 * asynchronously.  Otherwise try to cluster, and if that
+		 * doesn't do it then either do an async write (if O_DIRECT),
+		 * or a delayed write (if not).
+		 */
 		if (ioflag & IO_SYNC) {
 			(void)bwrite(bp);
+		} else if (vm_page_count_severe() ||
+		    buf_dirty_count_severe() ||
+		    (ioflag & IO_ASYNC)) {
+			bp->b_flags |= B_CLUSTEROK;
+			bawrite(bp);
 		} else if (xfersize + blkoffset == fs->e2fs_fsize) {
 			if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERW) == 0) {
 				bp->b_flags |= B_CLUSTEROK;
@@ -260,6 +345,9 @@ WRITE(ap)
 			} else {
 				bawrite(bp);
 			}
+		} else if (ioflag & IO_DIRECT) {
+			bp->b_flags |= B_CLUSTEROK;
+			bawrite(bp);
 		} else {
 			bp->b_flags |= B_CLUSTEROK;
 			bdwrite(bp);
@@ -271,18 +359,13 @@ WRITE(ap)
 	 * If we successfully wrote any data, and we are not the superuser
 	 * we clear the setuid and setgid bits as a precaution against
 	 * tampering.
-	 * XXX too late, the tamperer may have opened the file while we
-	 * were writing the data (or before).
-	 * XXX too early, if (error && ioflag & IO_UNIT) then we will
-	 * unwrite the data.
 	 */
-	if (resid > uio->uio_resid && ap->a_cred && ap->a_cred->cr_uid != 0)
-		ip->i_mode &= ~(ISUID | ISGID);
+	if ((ip->i_mode & (ISUID | ISGID)) && resid > uio->uio_resid &&
+	    ap->a_cred) {
+		if (priv_check_cred(ap->a_cred, PRIV_VFS_RETAINSUGID, 0))
+			ip->i_mode &= ~(ISUID | ISGID);
+	}
 	if (error) {
-                /*
-                 * XXX should truncate to the last successfully written
-                 * data if the uiomove() failed.
-                 */
 		if (ioflag & IO_UNIT) {
 			(void)ext2_truncate(vp, osize,
 			    ioflag & IO_SYNC, ap->a_cred, uio->uio_td);

Modified: head/sys/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_vnops.c	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/ext2_vnops.c	Thu Apr 28 14:27:17 2011	(r221166)
@@ -738,7 +738,7 @@ ext2_link(ap)
 	}
 	ip->i_nlink++;
 	ip->i_flag |= IN_CHANGE;
-	error = ext2_update(vp, 1);
+	error = ext2_update(vp, !DOINGASYNC(vp));
 	if (!error)
 		error = ext2_direnter(ip, tdvp, cnp);
 	if (error) {
@@ -884,7 +884,7 @@ abortit:
 	 */
 	ip->i_nlink++;
 	ip->i_flag |= IN_CHANGE;
-	if ((error = ext2_update(fvp, 1)) != 0) {
+	if ((error = ext2_update(fvp, !DOINGASYNC(fvp))) != 0) {
 		VOP_UNLOCK(fvp, 0);
 		goto bad;
 	}
@@ -943,7 +943,7 @@ abortit:
 			}
 			dp->i_nlink++;
 			dp->i_flag |= IN_CHANGE;
-			error = ext2_update(tdvp, 1);
+			error = ext2_update(tdvp, !DOINGASYNC(tdvp));
 			if (error)
 				goto bad;
 		}
@@ -1211,7 +1211,7 @@ ext2_mkdir(ap)
 	 */
 	dp->i_nlink++;
 	dp->i_flag |= IN_CHANGE;
-	error = ext2_update(dvp, 1);
+	error = ext2_update(dvp, !DOINGASYNC(dvp));
 	if (error)
 		goto bad;
 
@@ -1655,7 +1655,7 @@ ext2_makeinode(mode, dvp, vpp, cnp)
 	/*
 	 * Make sure inode goes to disk before directory entry.
 	 */
-	error = ext2_update(tvp, 1);
+	error = ext2_update(tvp, !DOINGASYNC(tvp));
 	if (error)
 		goto bad;
 	error = ext2_direnter(ip, dvp, cnp);

Modified: head/sys/fs/ext2fs/inode.h
==============================================================================
--- head/sys/fs/ext2fs/inode.h	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/fs/ext2fs/inode.h	Thu Apr 28 14:27:17 2011	(r221166)
@@ -158,6 +158,9 @@ struct indir {
 #define VTOI(vp)	((struct inode *)(vp)->v_data)
 #define ITOV(ip)	((ip)->i_vnode)
 
+/* Check whether the MNTK_ASYNC flag has been set for a mount point */
+#define DOINGASYNC(vp)		((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC)
+
 /* This overlays the fid structure (see mount.h). */
 struct ufid {
 	uint16_t ufid_len;	/* Length of structure. */

Modified: head/sys/modules/ext2fs/Makefile
==============================================================================
--- head/sys/modules/ext2fs/Makefile	Thu Apr 28 14:01:23 2011	(r221165)
+++ head/sys/modules/ext2fs/Makefile	Thu Apr 28 14:27:17 2011	(r221166)
@@ -2,7 +2,7 @@
 
 .PATH:	${.CURDIR}/../../fs/ext2fs
 KMOD=	ext2fs
-SRCS=	opt_ddb.h opt_quota.h opt_suiddir.h vnode_if.h \
+SRCS=	opt_ddb.h opt_directio.h opt_quota.h opt_suiddir.h vnode_if.h \
 	ext2_alloc.c ext2_balloc.c ext2_bmap.c ext2_inode.c \
 	ext2_inode_cnv.c ext2_lookup.c ext2_subr.c ext2_vfsops.c \
 	ext2_vnops.c

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 14:33:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4527710656B5;
	Thu, 28 Apr 2011 14:33:16 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2F7558FC13;
	Thu, 28 Apr 2011 14:33:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SEXGKM027099;
	Thu, 28 Apr 2011 14:33:16 GMT (envelope-from gnn@svn.freebsd.org)
Received: (from gnn@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SEXGhh027089;
	Thu, 28 Apr 2011 14:33:16 GMT (envelope-from gnn@svn.freebsd.org)
Message-Id: <201104281433.p3SEXGhh027089@svn.freebsd.org>
From: "George V. Neville-Neil" 
Date: Thu, 28 Apr 2011 14:33:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221167 - in head: share/man/man4 sys/conf sys/dev/vxge
	sys/dev/vxge/include sys/dev/vxge/vxgehal sys/modules/vxge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 14:33:16 -0000

Author: gnn
Date: Thu Apr 28 14:33:15 2011
New Revision: 221167
URL: http://svn.freebsd.org/changeset/base/221167

Log:
  Exar driver for X3100 10GbE Server/Storage adapters
  
  Features: Jumbo frames (up to 9600), LRO (Large Receive Offload),
            TSO (TCP segmentation offload), RTH (Receive Traffic Hash).
  
  Submitted by: Sriram Rapuru at Exar
  MFC after:	2 weeks

Added:
  head/share/man/man4/vxge.4   (contents, props changed)
  head/sys/dev/vxge/
  head/sys/dev/vxge/LICENSE   (contents, props changed)
  head/sys/dev/vxge/README   (contents, props changed)
  head/sys/dev/vxge/include/
  head/sys/dev/vxge/include/build-version.h   (contents, props changed)
  head/sys/dev/vxge/include/vxge-debug.h   (contents, props changed)
  head/sys/dev/vxge/include/vxge-defs.h   (contents, props changed)
  head/sys/dev/vxge/include/vxge-list.h   (contents, props changed)
  head/sys/dev/vxge/include/vxge-os-debug.h   (contents, props changed)
  head/sys/dev/vxge/include/vxge-os-pal.h   (contents, props changed)
  head/sys/dev/vxge/include/vxge-queue.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-config.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-ll.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-mgmt.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-mgmtaux.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-stats.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-status.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-types.h   (contents, props changed)
  head/sys/dev/vxge/include/vxgehal-version.h   (contents, props changed)
  head/sys/dev/vxge/vxge-firmware.h   (contents, props changed)
  head/sys/dev/vxge/vxge-osdep.h   (contents, props changed)
  head/sys/dev/vxge/vxge.c   (contents, props changed)
  head/sys/dev/vxge/vxge.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/
  head/sys/dev/vxge/vxgehal/vxge-queue.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-blockpool.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-blockpool.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-channel.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-channel.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-common-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-config-priv.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-config.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-debug.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-device.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-device.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-doorbells.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-doorbells.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-driver.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-driver.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-fifo.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-fifo.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-ifmsg.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-ifmsg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-legacy-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-memrepair-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mgmt.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mgmtaux.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mm.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mm.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mrpcim-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-mrpcim.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-pcicfgmgmt-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-regdefs.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-regs.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-ring.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-ring.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-srpcim-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-srpcim.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-srpcim.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-swapper.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-swapper.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-toc-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-virtualpath.c   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-virtualpath.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-vpath-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal-vpmgmt-reg.h   (contents, props changed)
  head/sys/dev/vxge/vxgehal/vxgehal.h   (contents, props changed)
  head/sys/dev/vxge/vxgell-version.h   (contents, props changed)
  head/sys/modules/vxge/
  head/sys/modules/vxge/Makefile   (contents, props changed)
Modified:
  head/sys/conf/NOTES
  head/sys/conf/files

Added: head/share/man/man4/vxge.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/vxge.4	Thu Apr 28 14:33:15 2011	(r221167)
@@ -0,0 +1,111 @@
+.\" Copyright (c) 2002-2011 Exar Corp.
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer as
+.\"    the first lines of this file unmodified.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd March 16, 2011
+.Dt VXGE 1
+.Os
+.Sh NAME
+.Nm vxge
+.Nd "Neterion X3100 10GbE Server/Storage adapter driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device vxge"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_vxge_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for Neterion X3100 adapters.
+The driver supports TCP Segmentation Offload (TSO/LSO), 
+Large Receive Offlaod (LRO), Jumbo Frames, Receive Traffic Hash (RTH),
+VLAN, Promiscuous mode and Multi function mode.
+.Pp
+
+The
+.Nm
+driver supports following function modes:
+.Bd -ragged -offset indent
+.Cd "SF1_VP17 - 1 function with 17 VPATHs"
+.Ed
+.Bd -ragged -offset indent
+.Cd "MF8_VP2 - 8 functions with 2 VPATHs per function"
+.Ed
+.Bd -ragged -offset indent
+.Cd "MF2_VP8 - 2 functions, 8 Paths/Function"
+.Ed
+.Bd -ragged -offset indent
+.Cd "MF4_VP4 - 4 Functions, 4 Paths/Function"
+.Ed
+.Bd -ragged -offset indent
+.Cd "MF8P_VP2 - 8 functions with 2 VPATHs per function required for DirectIO"
+.Ed
+.Pp
+For general information and support, please visit the Neterion support page
+.Pa http://www.neterion.com/support/support.html .
+.Pp
+Support for Jumbo Frames is provided via the interface MTU setting.
+Selecting an MTU larger than 1500 bytes with the
+.Xr ifconfig 8
+utility configures the adapter to transmit and receive Jumbo Frames.
+X3100 adapters support Jumbo Frames up to 9600 bytes.
+.Pp
+For Jumbo Frames, the driver will try to allocate physically contiguous buffers.
+Failures to do so may degrade the performance.
+To resolve such problems, please visit
+.Pa http://www.neterion.com
+where additional information and a kernel patch can be found.
+.Pp
+For more information on configuring this device, see
+.Xr ifconfig 8 .
+.Sh HARDWARE
+The
+.Nm
+driver supports Neterion X3100 10 Gigabit Ethernet adapters listed in
+.Pa http://www.neterion.com .
+.Sh SUPPORT
+For troubleshooting tips and FAQs, please visit
+.Pa http://trac.neterion.com/cgi-bin/trac.cgi/wiki/TitleIndex?anonymous .
+.Pp
+For any issues please send an email to
+.Aq support@neterion.com .
+.Sh SEE ALSO
+.Xr arp 8 ,
+.Xr ifconfig 8
+.Sh AUTHORS
+The
+.Nm
+driver was written by
+.An Neterion
+.Aq support@neterion.com .

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Thu Apr 28 14:27:17 2011	(r221166)
+++ head/sys/conf/NOTES	Thu Apr 28 14:33:15 2011	(r221167)
@@ -2094,6 +2094,7 @@ device		nxge		# Neterion Xframe 10GbE Se
 device		ti		# Alteon Networks Tigon I/II gigabit Ethernet
 device		txp		# 3Com 3cR990 (``Typhoon'')
 device		vx		# 3Com 3c590, 3c595 (``Vortex'')
+device		vxge		# Exar/Neterion XFrame 3100 10GbE
 
 # PCI FDDI NICs.
 device		fpa

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Apr 28 14:27:17 2011	(r221166)
+++ head/sys/conf/files	Thu Apr 28 14:33:15 2011	(r221167)
@@ -1970,6 +1970,24 @@ dev/vte/if_vte.c		optional vte pci
 dev/vx/if_vx.c			optional vx
 dev/vx/if_vx_eisa.c		optional vx eisa
 dev/vx/if_vx_pci.c		optional vx pci
+dev/vxge/vxge.c				optional vxge
+dev/vxge/vxgehal/vxgehal-ifmsg.c	optional vxge
+dev/vxge/vxgehal/vxgehal-mrpcim.c	optional vxge
+dev/vxge/vxgehal/vxge-queue.c		optional vxge
+dev/vxge/vxgehal/vxgehal-ring.c		optional vxge
+dev/vxge/vxgehal/vxgehal-swapper.c	optional vxge
+dev/vxge/vxgehal/vxgehal-mgmt.c		optional vxge
+dev/vxge/vxgehal/vxgehal-srpcim.c	optional vxge
+dev/vxge/vxgehal/vxgehal-config.c	optional vxge
+dev/vxge/vxgehal/vxgehal-blockpool.c	optional vxge
+dev/vxge/vxgehal/vxgehal-doorbells.c	optional vxge
+dev/vxge/vxgehal/vxgehal-mgmtaux.c	optional vxge
+dev/vxge/vxgehal/vxgehal-device.c	optional vxge
+dev/vxge/vxgehal/vxgehal-mm.c		optional vxge
+dev/vxge/vxgehal/vxgehal-driver.c	optional vxge
+dev/vxge/vxgehal/vxgehal-virtualpath.c	optional vxge
+dev/vxge/vxgehal/vxgehal-channel.c	optional vxge
+dev/vxge/vxgehal/vxgehal-fifo.c		optional vxge
 dev/watchdog/watchdog.c		standard
 dev/wb/if_wb.c			optional wb pci
 dev/wds/wd7000.c		optional wds isa

Added: head/sys/dev/vxge/LICENSE
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/vxge/LICENSE	Thu Apr 28 14:33:15 2011	(r221167)
@@ -0,0 +1,31 @@
+/*-
+ *  Copyright (c) 2002-2010 Exar Corp.
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification are permitted provided the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *
+ *    3. Neither the name of the Exar Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived from
+ *       this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ *  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.
+ */
+/*$FreeBSD$*/
\ No newline at end of file

Added: head/sys/dev/vxge/README
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/vxge/README	Thu Apr 28 14:33:15 2011	(r221167)
@@ -0,0 +1,450 @@
+$FreeBSD$
+''_Readme for FreeBSD X3100 Series 10GbE PCIe I/O Virtualized Server Adapter Drivers_'''
+
+=== Introduction ===
+FreeBSD Driver for X3100 10GbE Server/Storage adapters 
+* Drivers support all X3100 10GbE adapters with FreeBSD version 7.x, 8.x and 9.x
+* Supports both i386 and amd64 architectures
+* Features:	Jumbo frames (up to 9600),
+		LRO (Large Receive Offload),
+		TSO (TCP segmentation offload),
+		RTH (Receive Traffic Hash).
+   Also, Extended Message Signaled Interrupts (MSI-X).
+
+
+''Features''
+
+    a.	Jumbo frames:
+	X3110 and X3120 supports MTU up to 9600 bytes, modifiable using ifconfig command.
+
+    b.	LRO (Large Receive Offload):
+	LRO can be enabled/disabled before loading driver.
+	Set lro_enable in vxge.conf to 1 before loading driver.
+
+    c.	TSO (TCP Segmentation Offload)
+	TSO can be enabled/disabled before loading driver.
+	Set tso_enable in vxge.conf to 1 before loading driver.
+
+    d.	RTH (Receive Traffic Hash)
+	Receive side steering for better scaling.
+	Set rth_enable in vxge.conf to 1 before loading driver.
+
+    e.	MSI-X
+	Can be enabled on platforms which support it, resulting in noticeable
+	performance improvement. 
+
+    f.	Multi-VPaths
+	Up to 17 hardware based transmit and receive data channels, with
+	multiple steering options.
+
+
+''X3100 & Driver configuration: vxge.conf''
+
+The vxge.conf contains following attributes.
+
+
+''msix_enable''
+
+Enable MSI (Message Signaled Interrupts) feature in driver.
+0 - INTA
+1 - MSI-X
+Default: 1
+
+
+''rth_enable''
+
+Enables Receive side steering for better scaling (RTH - Receive Traffic Hash)
+Range: 0 - 1
+Default: 1
+
+
+''lro_enable''
+
+Enables LRO (Large Receive Offload) feature in driver.
+Range: 0 - 1
+Default: 1
+
+
+''tso_enable''
+
+Enables TSO (TCP Segmentaton Offload) feature in driver.
+Range: 0 - 1
+Default: 1
+
+
+''no_of_vpath''
+
+Specifies maximum VPATH(s) configured for each device function.
+Valid range: 1-17
+Default: Optimized by driver
+
+
+''func_mode''
+
+Change PCI function mode
+    0  - SF1_VP17 (1 function with 17 VPATHs)
+    1  - MF8_VP2  (8 functions with 2 VPATHs per function)
+    8  - MF2_VP8  (2 functions, 8 Paths/Function)
+    9  - MF4_VP4  (4 Functions, 4 Paths/Function)
+    11 - MF8P_VP2 (8 functions with 2 VPATHS per function required for DirectIO)
+    Default: -1
+
+
+''port_mode''
+
+Change the default dual port mode
+    2 - Active Passive
+    3 - Single Port
+    4 - Dual Port
+
+
+''l2_switch''
+
+Turn on/off the inter function traffic through l2 switch
+    0 - Disallow inter function traffic
+    1 - Allow inter function traffic
+    Default: -1
+
+
+''bandwidth_0 - bandwidth_7''
+
+    Desired max receive/transmit bandwidth,in Mbps for function 0 to function 7
+    Minimum value is 100 Mbps, for 1 Gbps specify a value of 1024.
+
+
+''priority_0 - priority_7''
+
+    Desired receive/transmit priority for function 0 to function 7 
+
+
+''intr_coalesce''
+
+    Adaptive interrupt coalescing
+    0 - Disable
+    1 - Enable
+
+
+''Low Latency''
+
+   0 - Disable
+   1 - Enable
+
+=== Installation Instructions ===
+
+''Identifying the Adapter''
+
+    The X3100 adapter is identified by the board ID number on the adapter.
+
+    Look for a label that has a barcode and a number, for example,
+    SXT0425072. The factory-burned MAC address (hardware address)
+    shows up on the board above the serial number, 
+    (similar to 000CFC000449 -- 00:0C:FC:00:04:49).
+
+
+''Kernel Driver Source Package''
+
+This package contains kernel_update.sh script which is to be used to copy driver sources to kernel path.
+It creates vxge folder with source code in /usr/src/sys/dev and Makefile in /usr/src/sys/modules.
+
+Loadable parameters can be changed by putting below lines in /boot/device.hints and set values as desired.
+	hint.vxge.0.msix_enable="1"
+	hint.vxge.0.rth_enable="1"
+	hint.vxge.0.lro_enable="1"
+	hint.vxge.0.tso_enable="1"
+	hint.vxge.0.tx_steering="1"
+	hint.vxge.0.no_of_vpath="-1"
+	hint.vxge.0.func_mode="-1"
+	hint.vxge.0.port_mode="-1"
+	hint.vxge.0.fw_upgrade="1"
+	hint.vxge.0.bandwidth_0="-1"
+	hint.vxge.0.bandwidth_1="-1"
+	hint.vxge.0.bandwidth_2="-1"
+	hint.vxge.0.bandwidth_3="-1"
+	hint.vxge.0.bandwidth_4="-1"
+	hint.vxge.0.bandwidth_5="-1"
+	hint.vxge.0.bandwidth_6="-1"
+	hint.vxge.0.bandwidth_7="-1"
+	hint.vxge.0.priority_0="-1"
+	hint.vxge.0.priority_1="-1"
+	hint.vxge.0.priority_2="-1"
+	hint.vxge.0.priority_3="-1"
+	hint.vxge.0.priority_4="-1"
+	hint.vxge.0.priority_5="-1"
+	hint.vxge.0.priority_6="-1"
+	hint.vxge.0.priority_7="-1"
+	hint.vxge.0.intr_coalesce="0"
+	hint.vxge.0.low_latency="0"
+
+	e.g., set hint.vxge.0.msix_enable to 0 to load driver in INTA mode.
+	Then reboot the system to add loadable parameters to kenv.
+
+
+''Standalone Driver Source Package''
+
+vxge (FreeBSD package)
+    This directory contains FreeBSD driver sources for X3100 device(s),
+    Makefile, and X3100 Hardware Abstraction headers and sources
+    (vxgehal and include folders)
+
+vxgehal
+    This directory contains the X3100 HAL sources.
+    The driver uses HAL to perform operations on the X3100 hardware.
+
+include
+    The include subdirectory contains HAL header files.
+ 
+Source code for vxge-manage tool (used to get statistics, pciconfig and
+register dump) are included in the freebsd directory.
+
+
+''Building the driver''
+
+    The driver is distributed in the source form. Driver and installation
+    utility executables need to be built for the target platform. 
+
+    In the directory containing Makefile for building Exar driver for FreeBSD, 
+	#make clean
+	#make
+
+    Please unload previously installed Exar drivers before proceeding with following steps.
+	#make uninstall
+
+
+''Loading the driver''
+
+     Use "kldload" to load driver module vxge.ko.
+	#kldload ./vxge.ko
+
+    Run "kldstat" and find an entry for vxge kernel module to ensure driver installation
+    was successful.
+	#kldstat | grep vxge
+	3 1 0xc22cc000 26000   vxge.ko
+
+
+''Enabling interface and assigning IP address''
+
+    #ifconfig   up
+     will be similar to vxge0, vxge1 etc. and can be
+    found by executing "ifconfig -a".
+    Neterion adapters typically have MAC addresses starting with
+    "00:0C:FC" or "00:11:25".
+
+    Example:
+	#ifconfig vxge0 10.2.2.40 up
+	Enables vxge0 interface and assigns to it the IP address 10.2.2.40.
+
+	vxge0: flags=8843 metric 0 mtu 1500
+	options=53b
+	ether 00:0c:fc:00:da:47
+	inet6 fe80::20c:fcff:fe00:da47%vxge0 prefixlen 64 scopeid 0x3
+	inet 10.2.2.40 netmask 0xff000000 broadcast 17.255.255.255
+	media: Ethernet autoselect (10Gbase-SR )
+	status: active
+
+
+''Disabling the interface''
+
+    #ifconfig  down
+    Example:
+	#ifconfig vxge0 down
+
+
+''Unloading the Driver''
+	#kldunload vxge.ko
+
+
+=== Performance Suggestions ===
+
+Sysctl Tuning Parameters
+	#sysctl net.inet.tcp.sendspace=786432
+	#sysctl net.inet.tcp.recvspace=786432
+	#sysctl net.inet.tcp.recvbuf_max=16777216
+	#sysctl net.inet.tcp.sendbuf_max=16777216
+	#sysctl net.inet.tcp.blackhole=1
+	#sysctl net.inet.tcp.rfc1323=1
+	#sysctl net.inet.tcp.path_mtu_discovery=1
+	#sysctl net.inet.tcp.inflight.enable=0
+	#sysctl net.inet.ip.maxfragsperpacket=2147483647
+	#sysctl kern.ipc.maxsockbuf=8388608
+	#sysctl kern.ipc.nmbclusters=2147483647
+	#sysctl kern.ipc.nmbjumbop=262144
+	#sysctl kern.ipc.maxsockets=81920
+	#sysctl hw.intr_storm_threshold=9000
+
+
+''Usage & Troubleshooting''
+
+For general information and support, please visit Neterion support website at 
+http://www.neterion.com/support/support.html
+
+Make sure that the operating system identifies the X3100 adapter. Note that
+Neterion vendor ID is 0x17D5 and X3110 and X3120 adapters can be fixed to both PCIe slots.
+
+The rest of this section details troubleshooting tips and information. Some of
+them are general and some are more specific. For online Troubleshooting tips 
+and faqs, please visit
+http://trac.neterion.com/cgi-bin/trac.cgi/wiki/TitleIndex?anonymous
+
+
+''Loading the driver and initializing the device''
+
+The first time FreeBSD identifies the device it stores the corresponding
+device/vendor IDs in an enumerated tree of PCI devices. Note that Neterion
+vendor id is 0x17d5.
+
+After cold reboot FreeBSD finds the device and tries to load the corresponding
+driver. If it fails, try to switch the card and/or cable. And, in parallel, send
+us the "tail" of the "/var/log/messages". We also need traces, register dump and
+statistics(Use vxge-manage tool).
+
+
+''Collect information''
+
+If you're reporting a problem to Neterion, please describe:
+host(s) and adapter(s), switch (if used), software version.
+
+
+''ARP''
+
+If this is a basic connectivity issue (e.g., cannot connect, cannot ping),
+make sure first that ARP works
+Do you see ARPs coming through a switch (in case switch is used)?
+Do you see frame drops at the switch when pinging?
+Do you see frame counts increasing via statistics?
+
+
+''Have you tried''
+
+    a. A previous driver release;
+    b. A different adapter in the same PCI slot;
+    c. A different PCI slot;
+    d. Back-to-back setup so that the switch is excluded from the equation.
+    e. To replace the cables?
+    f. To use a different PCI slot?
+
+
+''Start clean''
+
+    a. Have you tried to reboot the switch? Cold-reboot the host?
+    b. Make sure that the latest released driver gets loaded after the host
+    reboot, and that the 10GE interface shows up via ifconfig.
+
+
+''LEDs''
+
+Do you see LED going green after everything is connected and drivers loaded?
+How/when does the color changes?
+
+
+''ifconfig''
+
+Run "ifconfig -a" at the command prompt and check whether the output Looks as
+expected. Include the output in your problem report.
+
+Note for instance that "all-foxes" i.e, FF:FF:FF:FF:FF:FF MAC address could
+explain a general connectivity issue, if that's what you see.
+
+
+''Log''
+
+Please attach the generated log, with traces enabled.
+
+Note that the driver's logging facility is configurable at compile-time. Errors
+and traces can be compiled out on a per-component basis. The components are: HAL
+fifos and rings, device, etc., see VXGE_COMPONENT_HAL_??? in the Makefile.
+
+Here's how you enable all except data path traces:
+CFLAGS_VXGE = -DVXGE_DEBUG_MODULE_MASK=0xffffffbf  \
+-DVXGE_DEBUG_ERR_MASK=0xffffffbf
+Recompile with traces and include the log in the report.
+
+
+=== Utilities ===
+
+''Statistics''
+
+ To print hardware and software statistics for interface instance 0
+       (i.e., vxge0), run:
+	#vxge-manage vxgeX stats common
+	#vxge-manage vxgeX stats mrpcim
+	#vxge-manage vxgeX stats driver
+	#vxge-manage vxgeX pciconfig
+	#vxge-manage vxgeX hwinfo
+	#vxge-manage vxgeX bw_pri_get
+	#vxge-manage vxgeX bw_pri_get vf_id
+	#vxge-manage vxgeX port_mode_get
+
+The vxge-manage tool generates log file in the working directory. Once done, ping a
+few times, and collect the statistics again (Ping both from this and the remote
+machines).
+
+Many counters could be of interest. For example, "rx_vld_frms" counts all
+valid incoming Ethernet frames seen by the adapter. Information could be derived
+from the fact that (for instance) counter stay constant during ping, if that is
+what happening. For detailed description of the X3100 counters, please refer
+to the "X3100 User Guide".
+
+Please include the statistics into your problem report.
+
+
+''X3100 registers''
+
+       Use vxge-manage to dump all X3100 BAR0 space registers. Include this register dump
+       into your problem report.
+       #vxge-manage vxgeX regs
+
+
+''PCI configuration space''
+
+Use vxge-manage to retrieve PCI vendor, device, etc. Include the PCI configutation
+space in your problem report.
+	#vxge-manage vxgeX pciconfig
+
+
+''Hardware Info''
+
+To retrieve hardware info of device, e.g, serial / part number and function mode etc.
+use vxge-manage 
+	#vxge-manage vxgeX hwinfo
+
+
+''Bandwidth and Priority''
+
+Use vxge-manage to display Bandwidth and Priority information.
+	#vxge-manage vxgeX bw_pri_get
+	or
+	#vxge-manage vxgeX bw_pri_get vf_id
+
+vxge-manage can also be used to set bandwidth and priority for individual VF.
+	#vxge-manage vxgeX bw_pri_set vf_id bandwidth 
+	or
+	#vxge-manage vxgeX bw_pri_set vf_id bandwidth priority
+
+	Example:
+	#vxge-manage vxge0 bw_pri_set 0 1500
+	or
+	#vxge-manage vxge0 bw_pri_set 0 1500 1
+
+''Port mode''
+
+Use vxge-manage to display Port mode setting
+	#vxge-manage vxgeX port_mode_get
+
+vxge-manage can also be used to set Port mode.
+	#vxge-manage vxgeX port_mode_set port_mode_value
+
+	Example:
+	#vxge-manage vxge0 port_mode_set 2
+
+=== Known Issues ===
+
+
+=== Available Downloads ===
+
+   For latest available drivers or further support please contact your network
+   adapter provider or neterionsupport@exar.com.
+
+
+===================================================================
+ Exar Corp., Proprietary
+ COPYRIGHT (c) 2002-2011 Exar corp., ALL RIGHTS RESERVED

Added: head/sys/dev/vxge/include/build-version.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/vxge/include/build-version.h	Thu Apr 28 14:33:15 2011	(r221167)
@@ -0,0 +1,7 @@
+/* $FreeBSD$ */
+
+#ifndef	BUILD_VERSION_H
+#define	BUILD_VERSION_H
+/* Do not edit! Automatically generated when released. */
+#define	GENERATED_BUILD_VERSION 22708
+#endif /* BUILD_VERSION_H */

Added: head/sys/dev/vxge/include/vxge-debug.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/vxge/include/vxge-debug.h	Thu Apr 28 14:33:15 2011	(r221167)
@@ -0,0 +1,159 @@
+/*-
+ * Copyright(c) 2002-2011 Exar Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification are permitted provided the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *
+ *    3. Neither the name of the Exar Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived from
+ *       this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * 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.
+ */
+/*$FreeBSD$*/
+
+#ifndef	VXGE_DEBUG_H
+#define	VXGE_DEBUG_H
+
+__EXTERN_BEGIN_DECLS
+
+/*
+ * __FUNCTION__ is, together with __PRETTY_FUNCTION__ or something similar,
+ * a gcc extension. we'll have to #if defined around that, and provide some
+ * meaningful replacement for those, so to make some gcc versions happier
+ */
+#ifndef	__func__
+#if defined(__FUNCTION__)
+#define	__func__ __FUNCTION__
+#else
+#define	__func__ " "
+#endif
+#endif
+
+#define	NULL_HLDEV					NULL
+#define	NULL_VPID					0xFFFFFFFF
+
+#define	VXGE_DEBUG_MODULE_MASK_DEF			0xFFFFFFFF
+#define	VXGE_DEBUG_LEVEL_DEF				VXGE_TRACE
+
+extern u32 g_debug_level;
+
+#ifndef	VXGE_DEBUG_MODULE_MASK
+#define	VXGE_DEBUG_MODULE_MASK				0
+#endif
+
+/*
+ * enum vxge_debug_level_e
+ * @VXGE_NONE: debug disabled
+ * @VXGE_ERR: all errors going to be logged out
+ * @VXGE_INFO: all errors plus all kind of info tracing print outs
+ *		going to be logged out. noisy.
+ * @VXGE_TRACE: all errors, all info plus all function entry and exit
+ *		and parameters. Very noisy
+ *
+ * This enumeration going to be used to switch between different
+ * debug levels during runtime if DEBUG macro defined during
+ * compilation. If DEBUG macro not defined than code will be
+ * compiled out.
+ */
+typedef enum vxge_debug_level_e {
+	VXGE_NONE   = 0x0,
+	VXGE_ERR    = 0x1,
+	VXGE_INFO   = 0x2,
+	VXGE_TRACE  = 0x4,
+} vxge_debug_level_e;
+
+/*
+ * @VXGE_COMPONENT_HAL_DEVICE: do debug for vxge core device module
+ * @VXGE_COMPONENT_HAL_DEVICE_IRQ: do debug for vxge core device module in ISR
+ * @VXGE_COMPONENT_HAL_VAPTH: do debug for vxge core virtual path module
+ * @VXGE_COMPONENT_HAL_VAPTH_ISR: do debug for vxge core virtual path module in
+ *		ISR
+ * @VXGE_COMPONENT_HAL_CONFIG: do debug for vxge core config module
+ * @VXGE_COMPONENT_HAL_MM: do debug for vxge core memory module
+ * @VXGE_COMPONENT_HAL_POOL: do debug for vxge core memory pool module
+ * @VXGE_COMPONENT_HAL_QUEUE: do debug for vxge core queue module
+ * @VXGE_COMPONENT_HAL_BITMAP: do debug for vxge core BITMAP module
+ * @VXGE_COMPONENT_HAL_CHANNEL: do debug for vxge core channel module
+ * @VXGE_COMPONENT_HAL_FIFO: do debug for vxge core fifo module
+ * @VXGE_COMPONENT_HAL_RING: do debug for vxge core ring module
+ * @VXGE_COMPONENT_HAL_DMQ: do debug for vxge core DMQ module
+ * @VXGE_COMPONENT_HAL_UMQ: do debug for vxge core UMQ module
+ * @VXGE_COMPONENT_HAL_SQ: do debug for vxge core SQ module
+ * @VXGE_COMPONENT_HAL_SRQ: do debug for vxge core SRQ module
+ * @VXGE_COMPONENT_HAL_CQRQ: do debug for vxge core CRQ module
+ * @VXGE_COMPONENT_HAL_NCE: do debug for vxge core NCE module
+ * @VXGE_COMPONENT_HAL_STAG: do debug for vxge core STAG module
+ * @VXGE_COMPONENT_HAL_TCP: do debug for vxge core TCP module
+ * @VXGE_COMPONENT_HAL_LRO: do debug for vxge core LRO module
+ * @VXGE_COMPONENT_HAL_SPDM: do debug for vxge core SPDM module
+ * @VXGE_COMPONENT_HAL_SESSION: do debug for vxge core SESSION module
+ * @VXGE_COMPONENT_HAL_STATS: do debug for vxge core statistics module
+ * @VXGE_COMPONENT_HAL_MRPCIM: do debug for vxge KMA core mrpcim module
+ * @VXGE_COMPONENT_HAL_SRPCIM: do debug for vxge KMA core srpcim module
+ * @VXGE_COMPONENT_OSDEP: do debug for vxge KMA os dependent parts
+ * @VXGE_COMPONENT_LL: do debug for vxge link layer module
+ * @VXGE_COMPONENT_ULD: do debug for vxge upper layer driver
+ * @VXGE_COMPONENT_ALL: activate debug for all modules with no exceptions
+ *
+ * This enumeration going to be used to distinguish modules
+ * or libraries during compilation and runtime.  Makefile must declare
+ * VXGE_DEBUG_MODULE_MASK macro and set it to proper value.
+ */
+#define	VXGE_COMPONENT_HAL_DEVICE			0x00000001
+#define	VXGE_COMPONENT_HAL_DEVICE_IRQ			0x00000002
+#define	VXGE_COMPONENT_HAL_VPATH			0x00000004
+#define	VXGE_COMPONENT_HAL_VPATH_IRQ			0x00000008
+#define	VXGE_COMPONENT_HAL_CONFIG			0x00000010
+#define	VXGE_COMPONENT_HAL_MM				0x00000020
+#define	VXGE_COMPONENT_HAL_POOL				0x00000040
+#define	VXGE_COMPONENT_HAL_QUEUE			0x00000080
+#define	VXGE_COMPONENT_HAL_BITMAP			0x00000100
+#define	VXGE_COMPONENT_HAL_CHANNEL			0x00000200
+#define	VXGE_COMPONENT_HAL_FIFO				0x00000400
+#define	VXGE_COMPONENT_HAL_RING				0x00000800
+#define	VXGE_COMPONENT_HAL_DMQ				0x00001000
+#define	VXGE_COMPONENT_HAL_UMQ				0x00002000
+#define	VXGE_COMPONENT_HAL_SQ				0x00004000
+#define	VXGE_COMPONENT_HAL_SRQ				0x00008000
+#define	VXGE_COMPONENT_HAL_CQRQ				0x00010000
+#define	VXGE_COMPONENT_HAL_NCE				0x00020000
+#define	VXGE_COMPONENT_HAL_STAG				0x00040000
+#define	VXGE_COMPONENT_HAL_TCP				0x00080000
+#define	VXGE_COMPONENT_HAL_LRO				0x00100000
+#define	VXGE_COMPONENT_HAL_SPDM				0x00200000
+#define	VXGE_COMPONENT_HAL_SESSION			0x00400000
+#define	VXGE_COMPONENT_HAL_STATS			0x00800000
+#define	VXGE_COMPONENT_HAL_MRPCIM			0x01000000
+#define	VXGE_COMPONENT_HAL_MRPCIM_IRQ			0x02000000
+#define	VXGE_COMPONENT_HAL_SRPCIM			0x04000000
+#define	VXGE_COMPONENT_HAL_SRPCIM_IRQ			0x08000000
+#define	VXGE_COMPONENT_HAL_DRIVER			0x10000000
+
+/* space for CORE_XXX */
+#define	VXGE_COMPONENT_OSDEP				0x20000000
+#define	VXGE_COMPONENT_LL				0x40000000
+#define	VXGE_COMPONENT_ULD				0x80000000
+#define	VXGE_COMPONENT_ALL				0xffffffff
+
+__EXTERN_END_DECLS
+
+#endif	/* VXGE_DEBUG_H */

Added: head/sys/dev/vxge/include/vxge-defs.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/vxge/include/vxge-defs.h	Thu Apr 28 14:33:15 2011	(r221167)
@@ -0,0 +1,251 @@
+/*-
+ * Copyright(c) 2002-2011 Exar Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification are permitted provided the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *
+ *    3. Neither the name of the Exar Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived from
+ *       this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * 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.
+ */
+/*$FreeBSD$*/
+
+#ifndef	VXGE_DEFS_H
+#define	VXGE_DEFS_H
+
+#define	VXGE_PCI_VENDOR_ID			0x17D5
+#define	VXGE_PCI_DEVICE_ID_TITAN_1		0x5833
+#define	VXGE_PCI_REVISION_TITAN_1		1
+#define	VXGE_PCI_DEVICE_ID_TITAN_1A		0x5833
+#define	VXGE_PCI_REVISION_TITAN_1A		2
+#define	VXGE_PCI_DEVICE_ID_TITAN_2		0x5834
+#define	VXGE_PCI_REVISION_TITAN_2		1
+
+#define	VXGE_MIN_FW_MAJOR_VERSION		1
+#define	VXGE_MIN_FW_MINOR_VERSION		8
+#define	VXGE_MIN_FW_BUILD_NUMBER		1
+
+#define	VXGE_DRIVER_VENDOR			"Exar Corp."
+#define	VXGE_CHIP_FAMILY			"X3100"
+#define	VXGE_SUPPORTED_MEDIA_0			"Fiber"
+
+#define	VXGE_DRIVER_NAME			\
+	"Neterion X3100 10GbE PCIe Server Adapter Driver"
+/*
+ * mBIT(loc) - set bit at offset
+ */
+#define	mBIT(loc)		(0x8000000000000000ULL >> (loc))
+
+/*
+ * vBIT(val, loc, sz) - set bits at offset
+ */
+#define	vBIT(val, loc, sz)	(((u64)(val)) << (64-(loc)-(sz)))
+#define	vBIT32(val, loc, sz)	(((u32)(val)) << (32-(loc)-(sz)))
+
+/*
+ * bVALx(bits, loc) - Get the value of x bits at location
+ */
+#define	bVAL1(bits, loc)  ((((u64)bits) >> (64-(loc+1))) & 0x1)
+#define	bVAL2(bits, loc)  ((((u64)bits) >> (64-(loc+2))) & 0x3)
+#define	bVAL3(bits, loc)  ((((u64)bits) >> (64-(loc+3))) & 0x7)
+#define	bVAL4(bits, loc)  ((((u64)bits) >> (64-(loc+4))) & 0xF)
+#define	bVAL5(bits, loc)  ((((u64)bits) >> (64-(loc+5))) & 0x1F)
+#define	bVAL6(bits, loc)  ((((u64)bits) >> (64-(loc+6))) & 0x3F)
+#define	bVAL7(bits, loc)  ((((u64)bits) >> (64-(loc+7))) & 0x7F)
+#define	bVAL8(bits, loc)  ((((u64)bits) >> (64-(loc+8))) & 0xFF)
+#define	bVAL9(bits, loc)  ((((u64)bits) >> (64-(loc+9))) & 0x1FF)
+#define	bVAL11(bits, loc) ((((u64)bits) >> (64-(loc+11))) & 0x7FF)
+#define	bVAL12(bits, loc) ((((u64)bits) >> (64-(loc+12))) & 0xFFF)
+#define	bVAL14(bits, loc) ((((u64)bits) >> (64-(loc+14))) & 0x3FFF)
+#define	bVAL15(bits, loc) ((((u64)bits) >> (64-(loc+15))) & 0x7FFF)
+#define	bVAL16(bits, loc) ((((u64)bits) >> (64-(loc+16))) & 0xFFFF)
+#define	bVAL17(bits, loc) ((((u64)bits) >> (64-(loc+17))) & 0x1FFFF)
+#define	bVAL18(bits, loc) ((((u64)bits) >> (64-(loc+18))) & 0x3FFFF)
+#define	bVAL20(bits, loc) ((((u64)bits) >> (64-(loc+20))) & 0xFFFFF)
+#define	bVAL22(bits, loc) ((((u64)bits) >> (64-(loc+22))) & 0x3FFFFF)
+#define	bVAL24(bits, loc) ((((u64)bits) >> (64-(loc+24))) & 0xFFFFFF)
+#define	bVAL28(bits, loc) ((((u64)bits) >> (64-(loc+28))) & 0xFFFFFFF)
+#define	bVAL32(bits, loc) ((((u64)bits) >> (64-(loc+32))) & 0xFFFFFFFF)
+#define	bVAL36(bits, loc) ((((u64)bits) >> (64-(loc+36))) & 0xFFFFFFFFFULL)
+#define	bVAL40(bits, loc) ((((u64)bits) >> (64-(loc+40))) & 0xFFFFFFFFFFULL)
+#define	bVAL44(bits, loc) ((((u64)bits) >> (64-(loc+44))) & 0xFFFFFFFFFFFULL)
+#define	bVAL48(bits, loc) ((((u64)bits) >> (64-(loc+48))) & 0xFFFFFFFFFFFFULL)
+#define	bVAL52(bits, loc) ((((u64)bits) >> (64-(loc+52))) & 0xFFFFFFFFFFFFFULL)
+#define	bVAL56(bits, loc) ((((u64)bits) >> (64-(loc+56))) & 0xFFFFFFFFFFFFFFULL)
+#define	bVAL60(bits, loc)   \
+		((((u64)bits) >> (64-(loc+60))) & 0xFFFFFFFFFFFFFFFULL)
+#define	bVAL61(bits, loc)   \
+		((((u64)bits) >> (64-(loc+61))) & 0x1FFFFFFFFFFFFFFFULL)
+
+#define	VXGE_HAL_VPATH_BMAP_START	47
+#define	VXGE_HAL_VPATH_BMAP_END		63
+
+#define	VXGE_HAL_ALL_FOXES		0xFFFFFFFFFFFFFFFFULL
+
+#define	VXGE_HAL_INTR_MASK_ALL		0xFFFFFFFFFFFFFFFFULL
+
+#define	VXGE_HAL_MAX_VIRTUAL_PATHS	17
+
+#define	VXGE_HAL_MAX_FUNCTIONS		8
+
+#define	VXGE_HAL_MAX_ITABLE_ENTRIES	256
+
+#define	VXGE_HAL_MAX_RSS_KEY_SIZE	40
+
+#define	VXGE_HAL_MAC_MAX_WIRE_PORTS	2
+
+#define	VXGE_HAL_MAC_SWITCH_PORT	2
+
+#define	VXGE_HAL_MAC_MAX_AGGR_PORTS	2
+
+#define	VXGE_HAL_MAC_MAX_PORTS		3
+
+#define	VXGE_HAL_INTR_ALARM		(1<<4)
+
+#define	VXGE_HAL_INTR_TX		(1<<(3-VXGE_HAL_VPATH_INTR_TX))
+
+#define	VXGE_HAL_INTR_RX		(1<<(3-VXGE_HAL_VPATH_INTR_RX))
+
+#define	VXGE_HAL_INTR_EINTA		(1<<(3-VXGE_HAL_VPATH_INTR_EINTA))
+
+#define	VXGE_HAL_INTR_BMAP		(1<<(3-VXGE_HAL_VPATH_INTR_BMAP))
+
+#define	VXGE_HAL_PCI_CONFIG_SPACE_SIZE	VXGE_OS_PCI_CONFIG_SIZE
+
+#define	VXGE_HAL_DEFAULT_32		0xffffffff
+
+#define	VXGE_HAL_DEFAULT_64		0xffffffffffffffff
+
+#define	VXGE_HAL_DUMP_BUF_SIZE		0x10000
+
+#define	VXGE_HAL_VPD_BUFFER_SIZE	128
+
+#define	VXGE_HAL_VPD_LENGTH		80
+
+/* Check whether an address is multicast. */
+#define	VXGE_HAL_IS_NULL(Address)	(Address == 0x0000000000000000ULL)
+
+/* Check whether an address is multicast. */
+#define	VXGE_HAL_IS_MULTICAST(Address)	(Address & 0x0000010000000000ULL)
+
+/* Check whether an address is broadcast. */
+#define	VXGE_HAL_IS_BROADCAST(Address)	\
+	((Address & 0x0000FFFF00000000ULL) == 0x0000FFFF00000000ULL)
+
+#define	VXGE_HAL_IS_UNICAST(Address)		\
+	(!(VXGE_HAL_IS_NULL(Address) ||		\
+	VXGE_HAL_IS_MULTICAST(Address) ||	\
+	VXGE_HAL_IS_BROADCAST(Address)))
+
+/* frames sizes */
+#define	VXGE_HAL_HEADER_ETHERNET_II_802_3_SIZE		14
+#define	VXGE_HAL_HEADER_802_2_SIZE			3
+#define	VXGE_HAL_HEADER_SNAP_SIZE			5
+#define	VXGE_HAL_HEADER_VLAN_SIZE			4
+#define	VXGE_HAL_MAC_HEADER_MAX_SIZE \
+			(VXGE_HAL_HEADER_ETHERNET_II_802_3_SIZE + \
+			VXGE_HAL_HEADER_802_2_SIZE + \
+			VXGE_HAL_HEADER_SNAP_SIZE)
+
+#define	VXGE_HAL_TCPIP_HEADER_MAX_SIZE			(64 + 64)
+
+/* 32bit alignments */
+
+/* A receive data corruption can occur resulting in either a single-bit or
+double-bit ECC error being flagged in the ASIC if starting offset of a
+buffer in single buffer mode is 0x2 to 0xa. Single bit ECC error will not
+lock up the card but can hide the data corruption while the double-bit ECC
+error will lock up the card. Limiting the starting offset of the buffers to
+0x0, 0x1 or to a value greater than 0xF will workaround this issue.
+VXGE_HAL_HEADER_ETHERNET_II_802_3_ALIGN of 2 causes the starting offset of
+buffer to be 0x2, 0x12 and so on, to have the start of the ip header dword
+aligned. The start of buffer of 0x2 will cause this problem to occur.
+To avoid this problem in all cases, add 0x10 to 0x2, to ensure that the start
+of buffer is outside of the problem causing offsets.
+*/
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 14:43:38 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6C9DC1065672;
	Thu, 28 Apr 2011 14:43:38 +0000 (UTC)
	(envelope-from obrien@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B5668FC16;
	Thu, 28 Apr 2011 14:43:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SEhcLO027509;
	Thu, 28 Apr 2011 14:43:38 GMT (envelope-from obrien@svn.freebsd.org)
Received: (from obrien@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SEhcYb027507;
	Thu, 28 Apr 2011 14:43:38 GMT (envelope-from obrien@svn.freebsd.org)
Message-Id: <201104281443.p3SEhcYb027507@svn.freebsd.org>
From: "David E. O'Brien" 
Date: Thu, 28 Apr 2011 14:43:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221170 - in head/contrib/tcsh/nls: . pl
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 14:43:38 -0000

Author: obrien
Date: Thu Apr 28 14:43:38 2011
New Revision: 221170
URL: http://svn.freebsd.org/changeset/base/221170

Log:
  Remove unused GPL files from tcsh.

Deleted:
  head/contrib/tcsh/nls/pl/
Modified:
  head/contrib/tcsh/nls/Makefile

Modified: head/contrib/tcsh/nls/Makefile
==============================================================================
--- head/contrib/tcsh/nls/Makefile	Thu Apr 28 14:42:55 2011	(r221169)
+++ head/contrib/tcsh/nls/Makefile	Thu Apr 28 14:43:38 2011	(r221170)
@@ -1,6 +1,6 @@
 # $tcsh: Makefile,v 1.14 2006/03/02 18:46:45 christos Exp $
 
-SUBDIRS=	C et finnish french german greek italian ja pl russian \
+SUBDIRS=	C et finnish french german greek italian ja russian \
 		spanish ukrainian
 #GENCAT=	gencat --new
 CHARSET=	charset

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 14:47:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F3FCD106564A;
	Thu, 28 Apr 2011 14:47:42 +0000 (UTC)
	(envelope-from kostikbel@gmail.com)
Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B4C38FC12;
	Thu, 28 Apr 2011 14:47:41 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p3SElbUS030615
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 28 Apr 2011 17:47:37 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1])
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id
	p3SElbp4093497; Thu, 28 Apr 2011 17:47:37 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p3SElb8N093496; 
	Thu, 28 Apr 2011 17:47:37 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Thu, 28 Apr 2011 17:47:37 +0300
From: Kostik Belousov 
To: John Baldwin 
Message-ID: <20110428144737.GB48734@deviant.kiev.zoral.com.ua>
References: <201104281427.p3SERHo1026817@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="zGqVP2YgkFRp/g3j"
Content-Disposition: inline
In-Reply-To: <201104281427.p3SERHo1026817@svn.freebsd.org>
User-Agent: Mutt/1.4.2.3i
X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua
X-Virus-Status: Clean
X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	DNS_FROM_OPENWHOIS autolearn=no version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
	skuns.kiev.zoral.com.ua
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221166 - in head/sys: fs/ext2fs modules/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 14:47:43 -0000


--zGqVP2YgkFRp/g3j
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 28, 2011 at 02:27:17PM +0000, John Baldwin wrote:
> Author: jhb
> Date: Thu Apr 28 14:27:17 2011
> New Revision: 221166
> URL: http://svn.freebsd.org/changeset/base/221166
>=20
> Log:
>   Sync with several changes in UFS/FFS:
>   - 77115: Implement support for O_DIRECT.
>   - 98425: Fix a performance issue introduced in 70131 that was causing
>     reads before writes even when writing full blocks.
>   - 98658: Rename the BALLOC flags from B_* to BA_* to avoid confusion wi=
th
>     the struct buf B_ flags.
>   - 100344: Merge the BA_ and IO_ flags so so that they may both be used =
in
>     the same flags word. This merger is possible by assigning the IO_ fla=
gs
>     to the low sixteen bits and the BA_ flags the high sixteen bits.
>   - 105422: Fix a file-rewrite performance case.
>   - 129545: Implement IO_INVAL in VOP_WRITE() by marking the buffer as
>     "no cache".
>   - Readd the DOINGASYNC() macro and use it to control asynchronous write=
s.
>     Change i-node updates to honor DOINGASYNC() instead of always being
>     synchronous.
>   - Use a PRIV_VFS_RETAINSUGID check instead of checking cr_uid against 0
>     directly when deciding whether or not to clear suid and sgid bits.
>  =20
>   Submitted by:	Pedro F. Giffuni  giffunip at yahoo
>=20

> @@ -141,10 +162,42 @@ READ(ap)
>  		if (error)
>  			break;
> =20
> -		bqrelse(bp);
> +		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
> +		   (LIST_FIRST(&bp->b_dep) =3D=3D NULL)) {
> +			/*
> +			 * If there are no dependencies, and it's VMIO,
There is no dependencies for ext2fs, the FFS comments talks about SU.

Also, I am unsure what the resulting semantic of O_DIRECTIO for ext2
is ? UFS tries to eliminate any use of buffer cache for O_DIRECTIO
case, up to the mapping of user pages into pbuf to perform the
actual i/o. In ext2 case, it seems we will just destroy the buffers
after using them for i/o. Is it useful ?


--zGqVP2YgkFRp/g3j
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk25fgkACgkQC3+MBN1Mb4jmSgCgi2R5XScqXS6lzLZN6H62KL09
g20AoOqUTEF1cN7DUZsVKzm7uzf9V3Tv
=2UAt
-----END PGP SIGNATURE-----

--zGqVP2YgkFRp/g3j--

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 16:02:06 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8C290106573B;
	Thu, 28 Apr 2011 16:02:06 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6F32F8FC1D;
	Thu, 28 Apr 2011 16:02:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SG26Ls030107;
	Thu, 28 Apr 2011 16:02:06 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SG265H030096;
	Thu, 28 Apr 2011 16:02:06 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201104281602.p3SG265H030096@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 28 Apr 2011 16:02:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221173 - in head/sys: amd64/amd64 arm/arm i386/i386
	ia64/ia64 kern mips/mips powerpc/powerpc x86/x86
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 16:02:06 -0000

Author: attilio
Date: Thu Apr 28 16:02:05 2011
New Revision: 221173
URL: http://svn.freebsd.org/changeset/base/221173

Log:
  Add the watchdogs patting during the (shutdown time) disk syncing and
  disk dumping.
  With the option SW_WATCHDOG on, these operations are doomed to let
  watchdog fire, fi they take too long.
  
  I implemented the stubs this way because I really want wdog_kern_*
  KPI to not be dependant by SW_WATCHDOG being on (and really, the option
  only enables watchdog activation in hardclock) and also avoid to
  call them when not necessary (avoiding not-volountary watchdog
  activations).
  
  Sponsored by:	Sandvine Incorporated
  Discussed with:	emaste, des
  MFC after:	2 weeks

Modified:
  head/sys/amd64/amd64/minidump_machdep.c
  head/sys/arm/arm/dump_machdep.c
  head/sys/arm/arm/minidump_machdep.c
  head/sys/i386/i386/minidump_machdep.c
  head/sys/ia64/ia64/dump_machdep.c
  head/sys/kern/kern_shutdown.c
  head/sys/kern/vfs_subr.c
  head/sys/mips/mips/dump_machdep.c
  head/sys/powerpc/powerpc/dump_machdep.c
  head/sys/x86/x86/dump_machdep.c

Modified: head/sys/amd64/amd64/minidump_machdep.c
==============================================================================
--- head/sys/amd64/amd64/minidump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/amd64/amd64/minidump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,6 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -167,6 +172,9 @@ blk_write(struct dumperinfo *di, char *p
 			report_progress(progress, dumpsize);
 			counter &= (1<<24) - 1;
 		}
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		if (ptr) {
 			error = dump_write(di, ptr, 0, dumplo, len);
 			if (error)

Modified: head/sys/arm/arm/dump_machdep.c
==============================================================================
--- head/sys/arm/arm/dump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/arm/arm/dump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,6 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -189,6 +194,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
 			cpu_tlb_flushID_SE(0);
 			cpu_cpwait();
 		}
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		error = dump_write(di, 
 		    (void *)(pa - (pa & L1_ADDR_BITS)),0, dumplo, sz);
 		if (error)

Modified: head/sys/arm/arm/minidump_machdep.c
==============================================================================
--- head/sys/arm/arm/minidump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/arm/arm/minidump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -29,6 +29,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -36,6 +38,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -138,6 +143,9 @@ blk_write(struct dumperinfo *di, char *p
 			counter &= (1<<22) - 1;
 		}
 
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		if (ptr) {
 			error = dump_write(di, ptr, 0, dumplo, len);
 			if (error)

Modified: head/sys/i386/i386/minidump_machdep.c
==============================================================================
--- head/sys/i386/i386/minidump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/i386/i386/minidump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,6 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -138,6 +143,9 @@ blk_write(struct dumperinfo *di, char *p
 			printf(" %lld", PG2MB(progress >> PAGE_SHIFT));
 			counter &= (1<<24) - 1;
 		}
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		if (ptr) {
 			error = dump_write(di, ptr, 0, dumplo, len);
 			if (error)

Modified: head/sys/ia64/ia64/dump_machdep.c
==============================================================================
--- head/sys/ia64/ia64/dump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/ia64/ia64/dump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,12 +27,17 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -125,6 +130,9 @@ cb_dumpdata(struct efi_md *mdp, int seqn
 			printf("%c\b", "|/-\\"[twiddle++ & 3]);
 			counter &= (1<<24) - 1;
 		}
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		error = dump_write(di, (void*)pa, 0, dumplo, sz);
 		if (error)
 			break;

Modified: head/sys/kern/kern_shutdown.c
==============================================================================
--- head/sys/kern/kern_shutdown.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/kern/kern_shutdown.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_panic.h"
 #include "opt_show_busybufs.h"
 #include "opt_sched.h"
+#include "opt_watchdog.h"
 
 #include 
 #include 
@@ -65,6 +66,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 
 #include 
 
@@ -310,6 +314,9 @@ kern_reboot(int howto)
 
 		waittime = 0;
 
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		sync(curthread, NULL);
 
 		/*
@@ -335,6 +342,9 @@ kern_reboot(int howto)
 			if (nbusy < pbusy)
 				iter = 0;
 			pbusy = nbusy;
+#ifdef SW_WATCHDOG
+			wdog_kern_pat(WD_LASTVAL);
+#endif
 			sync(curthread, NULL);
 
 #ifdef PREEMPTION

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/kern/vfs_subr.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -42,6 +42,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ddb.h"
+#include "opt_watchdog.h"
 
 #include 
 #include 
@@ -72,6 +73,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 
 #include 
 
@@ -1839,6 +1843,10 @@ sched_sync(void)
 				LIST_INSERT_HEAD(next, bo, bo_synclist);
 				continue;
 			}
+#ifdef SW_WATCHDOG
+			if (first_printf == 0)
+				wdog_kern_pat(WD_LASTVAL);
+#endif
 		}
 		if (!LIST_EMPTY(gslp)) {
 			mtx_unlock(&sync_mtx);

Modified: head/sys/mips/mips/dump_machdep.c
==============================================================================
--- head/sys/mips/mips/dump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/mips/mips/dump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,6 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -35,6 +37,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -182,6 +187,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
 			counter &= (1<<24) - 1;
 		}
 
+#ifdef SW_WATCHDOG
+		wdog_kern_path(WD_LASTVAL);
+#endif
 		error = dump_write(di, (void *)(intptr_t)(pa),0, dumplo, sz); /* XXX fix PA */
 		if (error)
 			break;

Modified: head/sys/powerpc/powerpc/dump_machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/dump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/powerpc/powerpc/dump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,6 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -129,6 +134,9 @@ cb_dumpdata(struct pmap_md *md, int seqn
 			printf("%c\b", "|/-\\"[twiddle++ & 3]);
 			counter &= (1<<24) - 1;
 		}
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		error = di->dumper(di->priv, (void*)va, 0, dumplo, sz);
 		pmap_dumpsys_unmap(md, ofs, va);
 		if (error)

Modified: head/sys/x86/x86/dump_machdep.c
==============================================================================
--- head/sys/x86/x86/dump_machdep.c	Thu Apr 28 14:55:41 2011	(r221172)
+++ head/sys/x86/x86/dump_machdep.c	Thu Apr 28 16:02:05 2011	(r221173)
@@ -27,6 +27,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_watchdog.h"
+
 #include 
 #include 
 #include 
@@ -34,6 +36,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#ifdef SW_WATCHDOG
+#include 
+#endif
 #include 
 #include 
 #include 
@@ -193,6 +198,9 @@ cb_dumpdata(struct md_pa *mdp, int seqnr
 			a = pa + i * PAGE_SIZE;
 			va = pmap_kenter_temporary(trunc_page(a), i);
 		}
+#ifdef SW_WATCHDOG
+		wdog_kern_pat(WD_LASTVAL);
+#endif
 		error = dump_write(di, va, 0, dumplo, sz);
 		if (error)
 			break;

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 16:10:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79DCB1065674
	for ; Thu, 28 Apr 2011 16:10:55 +0000 (UTC)
	(envelope-from giffunip@yahoo.com)
Received: from nm10.bullet.mail.sp2.yahoo.com (nm10.bullet.mail.sp2.yahoo.com
	[98.139.91.80]) by mx1.freebsd.org (Postfix) with SMTP id 3E0888FC29
	for ; Thu, 28 Apr 2011 16:10:55 +0000 (UTC)
Received: from [98.139.91.62] by nm10.bullet.mail.sp2.yahoo.com with NNFMP;
	28 Apr 2011 15:57:53 -0000
Received: from [98.139.91.19] by tm2.bullet.mail.sp2.yahoo.com with NNFMP;
	28 Apr 2011 15:57:53 -0000
Received: from [127.0.0.1] by omp1019.mail.sp2.yahoo.com with NNFMP;
	28 Apr 2011 15:57:53 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 711827.74135.bm@omp1019.mail.sp2.yahoo.com
Received: (qmail 12188 invoked by uid 60001); 28 Apr 2011 15:57:53 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1304006273; bh=BiLKaJe8YkBuTs24ti0Tt9CxFYOg0v6HWAgR+DiQB4o=;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type;
	b=ABlAil0y7kg5lLM8+Xk7thZrTtjMA/YwjG0TF3xc/733+V5O8of5u0GVMTqumK7TUGHURpg7w7dAmAp6jMKfDCFcvmyUG6jvXGhinu7lbVA5IMvqtEIxNYleVMedeFZhtL+O88ieBKsyu2rD/6BpCbC3opl9/PVB3ee/Udu8fEM=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type;
	b=Z/6XnxB8U2XvS/oBHzII1yVQGXg8mnCeT+kaOykW8On/vWrB5fuzkmB3hVFwGz+WPIN84N6B4peYc4vGrPD4BUjKYV7clYvswSLYc4kHKh+eUkjiI8Zf5o+G5JPRAqhulp9yAeCfVSqCKRxv8exU9pDsk6FHdOIj2AVnPM5RAyo=;
Message-ID: <433267.83376.qm@web113513.mail.gq1.yahoo.com>
X-YMail-OSG: x7fE44MVM1kaWt9iRLhDWo.qkfp5rHfZCDsE9W0UIS1J0hi
	U90KY93YOafxSh2IDuvIk5m3YCUVEQvilq1.K4cGB_93VLBV0Sss92L3us91
	rMXiskNut2dm_sPneQVrWPleXVrhQTfgwRUpZ1RmabmaCX0mjo_KakrtfnM9
	oPQ2uUUjjrQblyoySrut_kVqJ8MBHkuKu8s_eCYMw9N_ungtHWzdWGjKqNsw
	lVvrXvsPc.iPRPr3KlO6hyrSjwEW1nCuC6yqnneuhdiib.pXYn8GyslUSvtM
	LhjmSEryl_CdYDYGiGh8aMivbm7Nt5YKQaC6aFr.N2zwN8YsDUh1PvELaCBn
	A7l8i2AG5IxxBQxfONQbFUv_yslV2OCOzORnnRjeow6MfLuIKjXeDJAps.3d
	hJQeesbJnaIFs
Received: from [190.157.141.135] by web113513.mail.gq1.yahoo.com via HTTP;
	Thu, 28 Apr 2011 08:57:53 PDT
X-Mailer: YahooMailClassic/12.0.2 YahooMailWebService/0.8.110.299900
Date: Thu, 28 Apr 2011 08:57:53 -0700 (PDT)
From: "Pedro F. Giffuni" 
To: Kostik Belousov 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Cc: svn-src-head@freebsd.org, John Baldwin 
Subject: Re: svn commit: r221166 - in head/sys: fs/ext2fs modules/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 16:10:55 -0000

> There is no dependencies for ext2fs, the FFS comments talks about SU.

You are right ... I will have to clean that up. It was not easy to
keep all SU stuff from getting in.

> Also, I am unsure what the resulting semantic of O_DIRECTIO for ext2
> is ? UFS tries to eliminate any use of buffer cache for O_DIRECTIO
> case, up to the mapping of user pages into pbuf to perform the
> actual i/o. In ext2 case, it seems we will just destroy the buffers
> after using them for i/o. Is it useful ?

We do not support the complete direct_io stuff (not even in UFS).
In ext2fs we are only avoiding double caching: it is assumed that
the application (usually databases) knows why it's setting
O_DIRECTIO and do their own caching. From what I discussed
with Tor Egge it is useful.

cheers,

Pedro.

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 16:29:20 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0679B106566B;
	Thu, 28 Apr 2011 16:29:20 +0000 (UTC) (envelope-from gnn@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E9B058FC0A;
	Thu, 28 Apr 2011 16:29:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SGTJZC030996;
	Thu, 28 Apr 2011 16:29:19 GMT (envelope-from gnn@svn.freebsd.org)
Received: (from gnn@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SGTJdi030990;
	Thu, 28 Apr 2011 16:29:19 GMT (envelope-from gnn@svn.freebsd.org)
Message-Id: <201104281629.p3SGTJdi030990@svn.freebsd.org>
From: "George V. Neville-Neil" 
Date: Thu, 28 Apr 2011 16:29:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221175 - in head/tools/tools: . vxge
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 16:29:20 -0000

Author: gnn
Date: Thu Apr 28 16:29:19 2011
New Revision: 221175
URL: http://svn.freebsd.org/changeset/base/221175

Log:
  A diagnostic tool to go along with the vxge(4) 10GbE driver.
  This tool can be used to print statistics, registers, and
  other device specific information once the driver is loaded
  into the kernel.
  
  Submitted by:	Sriram Rapuru from Exar
  MFC after:	2 weeks

Added:
  head/tools/tools/vxge/
  head/tools/tools/vxge/Makefile   (contents, props changed)
  head/tools/tools/vxge/vxge_cmn.h   (contents, props changed)
  head/tools/tools/vxge/vxge_info.c   (contents, props changed)
  head/tools/tools/vxge/vxge_info.h   (contents, props changed)
  head/tools/tools/vxge/vxge_log.c   (contents, props changed)
  head/tools/tools/vxge/vxge_log.h   (contents, props changed)
Modified:
  head/tools/tools/README

Modified: head/tools/tools/README
==============================================================================
--- head/tools/tools/README	Thu Apr 28 16:18:30 2011	(r221174)
+++ head/tools/tools/README	Thu Apr 28 16:29:19 2011	(r221175)
@@ -66,4 +66,5 @@ vimage		An interim utility for managing 
 		stack infrastructure.
 vop_table	Generates a HTML document that shows all the VOP's in
 		the kernel.
+vxge		A diagnostic tool for the vxge(4) driver
 whereintheworld	Summarizes "make world" output.

Added: head/tools/tools/vxge/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/vxge/Makefile	Thu Apr 28 16:29:19 2011	(r221175)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+PROG= vxge-manage
+SRCS= vxge_info.c vxge_log.c
+NO_MAN=
+ 
+.include 

Added: head/tools/tools/vxge/vxge_cmn.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/vxge/vxge_cmn.h	Thu Apr 28 16:29:19 2011	(r221175)
@@ -0,0 +1,260 @@
+/*-
+ * Copyright(c) 2002-2011 Exar Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification are permitted provided the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *
+ *    3. Neither the name of the Exar Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived from
+ *       this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * 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.
+ */
+/*$FreeBSD$*/
+
+#ifndef	_VXGE_CMN_H_
+#define	_VXGE_CMN_H_
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define	VXGE_OS_HOST_BIG_ENDIAN
+#else
+#define	VXGE_OS_HOST_LITTLE_ENDIAN
+#endif
+
+#if defined(VXGE_OS_HOST_BIG_ENDIAN)
+
+#define	GET_OFFSET_STATS(index)		statsInfo[(index)].be_offset
+#define	GET_OFFSET_PCICONF(index)	pciconfInfo[(index)].be_offset
+
+#else
+
+#define	GET_OFFSET_STATS(index)		statsInfo[(index)].le_offset
+#define	GET_OFFSET_PCICONF(index)	pciconfInfo[(index)].le_offset
+
+#endif
+
+#define	vxge_mem_free(x)	\
+	if (NULL != x) { free(x); x = NULL; }
+
+typedef uint8_t u8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef unsigned long long u64;
+typedef u_long ulong_t;
+
+typedef enum _vxge_query_device_info_e {
+
+	VXGE_GET_PCI_CONF = 100,
+	VXGE_GET_MRPCIM_STATS = 101,
+	VXGE_GET_DEVICE_STATS = 102,
+	VXGE_GET_DEVICE_HWINFO = 103,
+	VXGE_GET_DRIVER_STATS = 104,
+	VXGE_GET_INTR_STATS = 105,
+	VXGE_GET_VERSION = 106,
+	VXGE_GET_TCODE = 107,
+	VXGE_GET_VPATH_COUNT = 108,
+	VXGE_GET_BANDWIDTH = 109,
+	VXGE_SET_BANDWIDTH = 110,
+	VXGE_GET_PORT_MODE = 111,
+	VXGE_SET_PORT_MODE = 112
+
+} vxge_query_device_info_e;
+
+/* Register type enumaration */
+typedef enum vxge_hal_mgmt_reg_type_e {
+
+	vxge_hal_mgmt_reg_type_legacy = 0,
+	vxge_hal_mgmt_reg_type_toc = 1,
+	vxge_hal_mgmt_reg_type_common = 2,
+	vxge_hal_mgmt_reg_type_memrepair = 3,
+	vxge_hal_mgmt_reg_type_pcicfgmgmt = 4,
+	vxge_hal_mgmt_reg_type_mrpcim = 5,
+	vxge_hal_mgmt_reg_type_srpcim = 6,
+	vxge_hal_mgmt_reg_type_vpmgmt = 7,
+	vxge_hal_mgmt_reg_type_vpath = 8
+
+} vxge_hal_mgmt_reg_type_e;
+
+typedef enum vxge_hal_xmac_nwif_dp_mode {
+
+	VXGE_HAL_DP_NP_MODE_DEFAULT,
+	VXGE_HAL_DP_NP_MODE_LINK_AGGR,
+	VXGE_HAL_DP_NP_MODE_ACTIVE_PASSIVE,
+	VXGE_HAL_DP_NP_MODE_SINGLE_PORT,
+	VXGE_HAL_DP_NP_MODE_DUAL_PORT,
+	VXGE_HAL_DP_NP_MODE_DISABLE_PORT_MGMT
+
+} vxge_hal_xmac_nwif_dp_mode;
+
+typedef enum vxge_hal_xmac_nwif_behavior_on_failure {
+
+	VXGE_HAL_XMAC_NWIF_OnFailure_NoMove,
+	VXGE_HAL_XMAC_NWIF_OnFailure_OtherPort,
+	VXGE_HAL_XMAC_NWIF_OnFailure_OtherPortBackOnRestore
+
+} vxge_hal_xmac_nwif_behavior_on_failure;
+
+#define	VXGE_HAL_MGMT_REG_COUNT_LEGACY		7
+#define	VXGE_HAL_MGMT_REG_COUNT_TOC		11
+#define	VXGE_HAL_MGMT_REG_COUNT_COMMON		65
+#define	VXGE_HAL_MGMT_REG_COUNT_PCICFGMGMT	3
+#define	VXGE_HAL_MGMT_REG_COUNT_MRPCIM		1370
+#define	VXGE_HAL_MGMT_REG_COUNT_SRPCIM		48
+#define	VXGE_HAL_MGMT_REG_COUNT_VPMGMT		29
+#define	VXGE_HAL_MGMT_REG_COUNT_VPATH		139
+#define	VXGE_HAL_MGMT_STATS_COUNT_DRIVER	17
+#define	VXGE_HAL_MGMT_STATS_COUNT		160
+#define	VXGE_HAL_MGMT_STATS_COUNT_SW		54
+#define	VXGE_HAL_MGMT_STATS_COUNT_EXTENDED	56
+#define	VXGE_MAX_BANDWIDTH			10000
+
+#define	VXGE_HAL_MAX_VIRTUAL_PATHS		17
+#define	ETH_LENGTH_OF_ADDRESS			6
+
+typedef char macaddr[ETH_LENGTH_OF_ADDRESS];
+
+#define	VXGE_PRINT(fd, fmt...) {	\
+	fprintf(fd, fmt);		\
+	fprintf(fd, "\n");		\
+	printf(fmt);			\
+	printf("\n");			\
+}
+
+/* Read	& Write	Register */
+typedef struct _vxge_register_info_t {
+
+	u64	value;
+	u64	offset;
+	char	option[2];
+
+} vxge_register_info_t;
+
+/* Register Dump */
+typedef struct _vxge_pci_bar0_t {
+	char	name[64];
+	u64	offset;
+	u32	size;
+
+} vxge_pci_bar0_t;
+
+typedef struct _vxge_stats_driver_info_t {
+
+	char	name[32];
+	u64	value;
+
+} vxge_stats_driver_info_t;
+
+typedef struct _vxge_hal_device_pmd_info_t {
+
+	u32	type;
+	u32	unused;
+	char	vendor[24];
+	char	part_num[24];
+	char	ser_num[24];
+
+} vxge_hal_device_pmd_info_t;
+
+typedef struct _vxge_hal_device_version_t {
+
+	u32	major;
+	u32	minor;
+	u32	build;
+	char	version[32];
+
+} vxge_hal_device_version_t;
+
+typedef struct _vxge_hal_device_date_t {
+
+	u32	day;
+	u32	month;
+	u32	year;
+	char	date[16];
+
+} vxge_hal_device_date_t;
+
+typedef struct _vxge_hal_device_hw_info_t {
+
+	u32	host_type;
+	u64	function_mode;
+	u32	func_id;
+	u64	vpath_mask;
+
+	vxge_hal_device_version_t fw_version;
+	vxge_hal_device_date_t fw_date;
+	vxge_hal_device_version_t flash_version;
+	vxge_hal_device_date_t flash_date;
+
+	char	serial_number[24];
+	char	part_number[24];
+	char	product_description[72];
+	u32	unused;
+	u32	ports;
+
+	vxge_hal_device_pmd_info_t pmd_port0;
+	vxge_hal_device_pmd_info_t pmd_port1;
+
+	macaddr	mac_addrs[VXGE_HAL_MAX_VIRTUAL_PATHS];
+	macaddr	mac_addr_masks[VXGE_HAL_MAX_VIRTUAL_PATHS];
+
+} vxge_hal_device_hw_info_t;
+
+typedef struct _vxge_device_hw_info_t {
+
+	vxge_hal_device_hw_info_t hw_info;
+	u32	port_mode;
+	u32	port_failure;
+
+} vxge_device_hw_info_t;
+
+typedef struct _vxge_bw_info_t {
+
+	char	query;
+	u64	func_id;
+	int	priority;
+	int	bandwidth;
+
+} vxge_bw_info_t;
+
+typedef struct _vxge_port_info_t {
+
+	char	query;
+	int	port_mode;
+	int	port_failure;
+
+} vxge_port_info_t;
+
+u32	vxge_get_num_vpath(void);
+void	vxge_null_terminate(char *, size_t);
+
+#endif	/* _VXGE_CMN_H_ */

Added: head/tools/tools/vxge/vxge_info.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/tools/vxge/vxge_info.c	Thu Apr 28 16:29:19 2011	(r221175)
@@ -0,0 +1,857 @@
+/*-
+ * Copyright(c) 2002-2011 Exar Corp.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification are permitted provided the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice,
+ *       this list of conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *
+ *    3. Neither the name of the Exar Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived from
+ *       this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * 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.
+ */
+/*$FreeBSD$*/
+
+#include "vxge_info.h"
+
+static int sockfd;
+static struct ifreq ifr;
+
+int
+main(int argc, char *argv[])
+{
+	if (argc >= 4) {
+		if (!((strcasecmp(argv[2], "regs") == 0) ||
+		    (strcasecmp(argv[2], "stats") == 0) ||
+		    (strcasecmp(argv[2], "bw_pri_set") == 0) ||
+		    (strcasecmp(argv[2], "port_mode_set") == 0) ||
+		    (strcasecmp(argv[2], "bw_pri_get") == 0)))
+			goto out;
+		else {
+			if (strcasecmp(argv[2], "regs") == 0) {
+				if (!((strcasecmp(argv[3], "common") == 0) ||
+				    (strcasecmp(argv[3], "legacy") == 0) ||
+				    (strcasecmp(argv[3], "pcicfgmgmt") == 0) ||
+				    (strcasecmp(argv[3], "toc") == 0) ||
+				    (strcasecmp(argv[3], "vpath") == 0) ||
+				    (strcasecmp(argv[3], "vpmgmt") == 0) ||
+				    (strcasecmp(argv[3], "mrpcim") == 0) ||
+				    (strcasecmp(argv[3], "srpcim") == 0) ||
+				    (strcasecmp(argv[3], "all") == 0))) {
+					goto regs;
+				}
+			} else if (strcasecmp(argv[2], "stats") == 0) {
+
+				if (!((strcasecmp(argv[3], "common") == 0) ||
+				    (strcasecmp(argv[3], "mrpcim") == 0) ||
+				    (strcasecmp(argv[3], "all") == 0) ||
+				    (strcasecmp(argv[3], "driver") == 0))) {
+					goto stats;
+				}
+			}
+		}
+	} else {
+		if (argc != 3)
+			goto out;
+		else {
+			if (!((strcasecmp(argv[2], "hwinfo") == 0) ||
+			    (strcasecmp(argv[2], "pciconfig") == 0) ||
+			    (strcasecmp(argv[2], "port_mode_get") == 0) ||
+			    (strcasecmp(argv[2], "bw_pri_get") == 0))) {
+				if (strcasecmp(argv[2], "regs") == 0)
+					goto regs;
+
+				if (strcasecmp(argv[2], "stats") == 0)
+					goto stats;
+
+				if (strcasecmp(argv[2], "bw_pri_set") == 0)
+					goto bw_pri_set;
+
+				if (strcasecmp(argv[2], "port_mode_set") == 0)
+					goto port_mode_set;
+
+				goto out;
+			}
+		}
+	}
+
+	sockfd = socket(AF_INET, SOCK_DGRAM, 0);
+	if (sockfd < 0) {
+		printf("Creating socket failed\n");
+		goto _exit0;
+	}
+
+	ifr.ifr_addr.sa_family = AF_INET;
+	strlcpy(ifr.ifr_name, argv[1], sizeof(ifr.ifr_name));
+
+	if (strcasecmp(argv[2], "pciconfig") == 0)
+		vxge_get_pci_config();
+
+	else if (strcasecmp(argv[2], "hwinfo") == 0)
+		vxge_get_hw_info();
+
+	else if (strcasecmp(argv[2], "vpathinfo") == 0)
+		vxge_get_num_vpath();
+
+	else if (strcasecmp(argv[2], "port_mode_get") == 0)
+		vxge_get_port_mode();
+
+	else if (strcasecmp(argv[2], "regs") == 0) {
+
+		if (strcasecmp(argv[3], "common") == 0)
+			vxge_get_registers_common();
+
+		else if (strcasecmp(argv[3], "toc") == 0)
+			vxge_get_registers_toc();
+
+		else if (strcasecmp(argv[3], "pcicfgmgmt") == 0)
+			vxge_get_registers_pcicfgmgmt();
+
+		else if (strcasecmp(argv[3], "vpath") == 0)
+			vxge_get_registers_vpath();
+
+		else if (strcasecmp(argv[3], "vpmgmt") == 0)
+			vxge_get_registers_vpmgmt();
+
+		else if (strcasecmp(argv[3], "srpcim") == 0)
+			vxge_get_registers_srpcim();
+
+		else if (strcasecmp(argv[3], "legacy") == 0)
+			vxge_get_registers_legacy();
+
+		if (strcasecmp(argv[3], "mrpcim") == 0)
+			vxge_get_registers_mrpcim();
+
+		else if (strcasecmp(argv[3], "all") == 0)
+			vxge_get_registers_all();
+
+	} else if (strcasecmp(argv[2], "stats") == 0) {
+
+		if (strcasecmp(argv[3], "mrpcim") == 0)
+			vxge_get_stats_mrpcim();
+
+		else if (strcasecmp(argv[3], "common") == 0)
+			vxge_get_stats_common();
+
+		else if (strcasecmp(argv[3], "all") == 0)
+			vxge_get_stats_all();
+
+		else if (strcasecmp(argv[3], "driver") == 0) {
+			if (argc == 4) {
+				vxge_get_stats_driver(-1);
+			} else if (argc == 6) {
+				if ((strcasecmp(argv[4], "vpath") == 0) &&
+				    (atoi(argv[5]) >= 0) &&
+				    (atoi(argv[5]) < 17)) {
+					vxge_get_stats_driver(atoi(argv[5]));
+				} else {
+					goto stats;
+				}
+			}
+		} else {
+			goto stats;
+		}
+	} else if (strcasecmp(argv[2], "port_mode_set") == 0) {
+		if ((atoi(argv[3]) >= 2) && (atoi(argv[3]) <= 4))
+			vxge_set_port_mode(atoi(argv[3]));
+		else
+			goto port_mode_set;
+	} else if (argc == 5) {
+		if (strcasecmp(argv[2], "bw_pri_set") == 0) {
+			if (((atoi(argv[3]) >= 0) && (atoi(argv[3]) < 8) &&
+			    (atoi(argv[4]) <= 10000)))
+				vxge_set_bw_priority(atoi(argv[3]),
+				    atoi(argv[4]), -1, VXGE_SET_BANDWIDTH);
+			else
+				goto bw_pri_set;
+		}
+	} else if (argc == 6) {
+		if (strcasecmp(argv[2], "bw_pri_set") == 0) {
+			if (((atoi(argv[3]) >= 0) && (atoi(argv[3]) < 8) &&
+			    (atoi(argv[4]) <= 10000)) && (atoi(argv[5]) <= 3))
+				vxge_set_bw_priority(atoi(argv[3]),
+				    atoi(argv[4]), atoi(argv[5]),
+				    VXGE_SET_BANDWIDTH);
+			else
+				goto bw_pri_set;
+		}
+	} else if (argc == 4) {
+		if (strcasecmp(argv[2], "bw_pri_get") == 0) {
+			if ((atoi(argv[3]) >= 0) && (atoi(argv[3]) < 8))
+				vxge_get_bw_priority(atoi(argv[3]), VXGE_GET_BANDWIDTH);
+			else
+				goto bw_pri_get;
+		}
+	} else if (argc == 3) {
+		if (strcasecmp(argv[2], "bw_pri_get") == 0)
+			vxge_get_bw_priority(-1, VXGE_GET_BANDWIDTH);
+		else
+			goto bw_pri_get;
+	}
+
+	goto _exit0;
+
+out:
+	printf("Usage: ");
+	printf("vxge-manage  ");
+	printf("[regs] [stats] [hwinfo] [bw_pri_get] [bw_pri_set] [port_mode_get] [port_mode_set] [pciconfig]\n");
+	printf("\tINTERFACE      : Interface (vxge0, vxge1, vxge2, ..)\n");
+	printf("\tregs           : Prints register values\n");
+	printf("\tstats          : Prints statistics\n");
+	printf("\tpciconfig      : Prints pci configuration space\n");
+	printf("\thwinfo         : Displays hardware information\n");
+	printf("\tbw_pri_get     : Displays bandwidth and priority information\n");
+	printf("\tbw_pri_set     : Set bandwidth and priority of a function\n");
+	printf("\tport_mode_get  : Displays dual port adapter's port mode\n");
+	printf("\tport_mode_set  : Set dual port adapter's port mode\n\n");
+	goto _exit0;
+
+regs:
+	printf("Regs\n");
+	printf("[common] [legacy] [pcicfgmgmt] [toc] [vpath] [vpmgmt] [mrpcim] [srpcim] [All]\n");
+	printf("\tcommon         : print common registers\n");
+	printf("\tlegacy         : print legacy registers\n");
+	printf("\tpcicfgmgmt     : print pcicfgmgmt registers\n");
+	printf("\ttoc            : print toc registers\n");
+	printf("\tvpath          : print vpath registers\n");
+	printf("\tvpmgmt         : print vpmgmt registers\n");
+	printf("\tmrpcim         : print mrpcim registers\n");
+	printf("\tsrpcim         : print srpcim registers\n\n");
+	goto _exit0;
+
+stats:
+	printf("Stats\n");
+	printf("[common] [mrpcim] [driver [vpath (< 17) ]] [All]\n");
+	printf("\tcommon         : print common statistics\n");
+	printf("\tmrpcim         : print mrpcim statistics\n");
+	printf("\tdriver         : print driver statistics\n");
+	printf("\tAll            : print all statistics\n\n");
+	goto _exit0;
+
+bw_pri_set:
+	printf("Bandwidth & Priority\n");
+	printf("[vf-id (0-7)] [bandwidth (100-10000)] [priority (0-3)]\n\n");
+	goto _exit0;
+
+bw_pri_get:
+	printf("Bandwidth & Priority\n");
+	printf("[vf-id (0-7)]\n\n");
+	goto _exit0;
+
+port_mode_set:
+	printf("Port mode Setting\n");
+	printf("[port mode value (2-4)]\n\n");
+	goto _exit0;
+
+_exit0:
+	return (0);
+}
+
+/*
+ * vxge_get_registers_all
+ */
+void
+vxge_get_registers_all(void)
+{
+	vxge_get_registers_legacy();
+	vxge_get_registers_toc();
+	vxge_get_registers_common();
+	vxge_get_registers_pcicfgmgmt();
+	vxge_get_registers_srpcim();
+	vxge_get_registers_mrpcim();
+	vxge_get_registers_vpmgmt();
+	vxge_get_registers_vpath();
+}
+
+int
+vxge_get_registers_common(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize =
+	    reginfo_registers[VXGE_HAL_MGMT_REG_COUNT_COMMON - 1].offset + 8;
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = vxge_hal_mgmt_reg_type_common;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting register values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_registers(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_registers_legacy
+ */
+int
+vxge_get_registers_legacy(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = reginfo_legacy[VXGE_HAL_MGMT_REG_COUNT_LEGACY - 1].offset + 8;
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = vxge_hal_mgmt_reg_type_legacy;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting register values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_registers_legacy(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_registers_toc
+ */
+int
+vxge_get_registers_toc(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = reginfo_toc[VXGE_HAL_MGMT_REG_COUNT_TOC - 1].offset + 8;
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = vxge_hal_mgmt_reg_type_toc;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting register values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_registers_toc(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_registers_pcicfgmgmt
+ */
+int
+vxge_get_registers_pcicfgmgmt(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = reginfo_pcicfgmgmt[VXGE_HAL_MGMT_REG_COUNT_PCICFGMGMT - 1].offset + 8;
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = vxge_hal_mgmt_reg_type_pcicfgmgmt;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting register values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_registers_pcicfgmgmt(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_registers_vpath
+ */
+int
+vxge_get_registers_vpath(void)
+{
+	int bufsize, err = 0;
+	u32 i, no_of_vpath;
+	char *buffer = NULL;
+
+	no_of_vpath = vxge_get_num_vpath();
+	bufsize = reginfo_vpath[VXGE_HAL_MGMT_REG_COUNT_VPATH - 1].offset + 8;
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	for (i = 0; i < no_of_vpath; i++) {
+
+		bzero(buffer, bufsize);
+		*buffer = vxge_hal_mgmt_reg_type_vpath;
+		*((u32 *) (buffer + sizeof(u32))) = i;
+
+		ifr.ifr_data = (caddr_t) buffer;
+		err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+		if ((err < 0) || (err == EINVAL)) {
+			printf("Getting register values failed\n");
+			goto _exit0;
+		}
+
+		vxge_print_registers_vpath(buffer, i);
+	}
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_registers_vpmgmt
+ */
+int
+vxge_get_registers_vpmgmt(void)
+{
+	int bufsize, err = 0;
+	u32 i, no_of_vpath;
+	char *buffer = NULL;
+
+	no_of_vpath = vxge_get_num_vpath();
+	bufsize = reginfo_vpmgmt[VXGE_HAL_MGMT_REG_COUNT_VPMGMT - 1].offset + 8;
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	for (i = 0; i < no_of_vpath; i++) {
+
+		bzero(buffer, bufsize);
+		*buffer = vxge_hal_mgmt_reg_type_vpmgmt;
+		*((u32 *) (buffer + sizeof(u32))) = i;
+
+		ifr.ifr_data = (caddr_t) buffer;
+		err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+		if ((err < 0) || (err == EINVAL)) {
+			printf("Getting register values failed\n");
+			goto _exit0;
+		}
+
+		vxge_print_registers_vpmgmt(buffer);
+	}
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+u32
+vxge_get_num_vpath(void)
+{
+	int err = 0;
+	u32 buffer, no_of_vpath = 0;
+
+	buffer = VXGE_GET_VPATH_COUNT;
+
+	ifr.ifr_data = (caddr_t) &buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if (err == 0)
+		no_of_vpath = buffer;
+	else
+		printf("Getting number of vpath failed\n");
+
+	return (no_of_vpath);
+}
+
+/*
+ * vxge_get_registers_mrpcim
+ */
+int
+vxge_get_registers_mrpcim(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = reginfo_mrpcim[VXGE_HAL_MGMT_REG_COUNT_MRPCIM - 1].offset + 8;
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = vxge_hal_mgmt_reg_type_mrpcim;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting register values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_registers_mrpcim(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_registers_srpcim
+ * Gets srpcim register values
+ * Returns EXIT_SUCCESS or EXIT_FAILURE
+ */
+int
+vxge_get_registers_srpcim(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = reginfo_srpcim[VXGE_HAL_MGMT_REG_COUNT_SRPCIM - 1].offset + 8;
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for register dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = vxge_hal_mgmt_reg_type_srpcim;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_1, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting register values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_registers_srpcim(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_stats_driver
+ */
+int
+vxge_get_stats_driver(int vpath_num)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = VXGE_HAL_MGMT_STATS_COUNT_DRIVER * sizeof(u64) *
+	    VXGE_HAL_MAX_VIRTUAL_PATHS;
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for driver statistics failed\n");
+		goto _exit0;
+	}
+
+	*buffer = VXGE_GET_DRIVER_STATS;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_0, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting Driver Statistics failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_stats_drv(buffer, vpath_num);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_stats_common
+ */
+int
+vxge_get_stats_common(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = 1024 * 64 * sizeof(char);
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for statistics dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = VXGE_GET_DEVICE_STATS;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_0, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting statistics values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_stats(buffer, VXGE_GET_DEVICE_STATS);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+
+}
+
+/*
+ * vxge_get_stats_mrpcim
+ */
+int
+vxge_get_stats_mrpcim(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = 1024 * 64 * sizeof(char);
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for statistics dump failed\n");
+		goto _exit0;
+	}
+
+	*buffer = VXGE_GET_MRPCIM_STATS;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_0, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting statistics values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_stats(buffer, VXGE_GET_MRPCIM_STATS);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+int
+vxge_get_pci_config(void)
+{
+	int bufsize, err = 0;
+	char *buffer = NULL;
+
+	bufsize = 64 * 1024 * sizeof(char);
+
+	buffer = (char *) vxge_mem_alloc(bufsize);
+	if (!buffer) {
+		printf("Allocating memory for pci config failed\n");
+		goto _exit0;
+	}
+
+	*buffer = VXGE_GET_PCI_CONF;
+
+	ifr.ifr_data = (caddr_t) buffer;
+	err = ioctl(sockfd, SIOCGPRIVATE_0, &ifr);
+	if ((err < 0) || (err == EINVAL)) {
+		printf("Getting pci config values failed\n");
+		goto _exit0;
+	}
+
+	vxge_print_pci_config(buffer);
+
+_exit0:
+	vxge_mem_free(buffer);
+	return (err);
+}
+
+/*
+ * vxge_get_hw_info
+ */
+int
+vxge_get_hw_info(void)
+{
+	int err = 0;
+	char *buffer = NULL;
+
+	buffer = (char *) vxge_mem_alloc(sizeof(vxge_device_hw_info_t));

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 16:31:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E547B1065676;
	Thu, 28 Apr 2011 16:31:53 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F12F8FC15;
	Thu, 28 Apr 2011 16:31:53 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 2AB6A46B9E;
	Thu, 28 Apr 2011 12:31:53 -0400 (EDT)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 955528A02A;
	Thu, 28 Apr 2011 12:31:52 -0400 (EDT)
From: John Baldwin 
To: Kostik Belousov 
Date: Thu, 28 Apr 2011 12:31:50 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; )
References: <201104281427.p3SERHo1026817@svn.freebsd.org>
	<20110428144737.GB48734@deviant.kiev.zoral.com.ua>
In-Reply-To: <20110428144737.GB48734@deviant.kiev.zoral.com.ua>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201104281231.51237.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Thu, 28 Apr 2011 12:31:52 -0400 (EDT)
Cc: svn-src-head@freebsd.org, "Pedro F. Giffuni" ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r221166 - in head/sys: fs/ext2fs modules/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 16:31:54 -0000

On Thursday, April 28, 2011 10:47:37 am Kostik Belousov wrote:
> On Thu, Apr 28, 2011 at 02:27:17PM +0000, John Baldwin wrote:
> > Author: jhb
> > Date: Thu Apr 28 14:27:17 2011
> > New Revision: 221166
> > URL: http://svn.freebsd.org/changeset/base/221166
> > 
> > Log:
> >   Sync with several changes in UFS/FFS:
> >   - 77115: Implement support for O_DIRECT.
> >   - 98425: Fix a performance issue introduced in 70131 that was causing
> >     reads before writes even when writing full blocks.
> >   - 98658: Rename the BALLOC flags from B_* to BA_* to avoid confusion with
> >     the struct buf B_ flags.
> >   - 100344: Merge the BA_ and IO_ flags so so that they may both be used in
> >     the same flags word. This merger is possible by assigning the IO_ flags
> >     to the low sixteen bits and the BA_ flags the high sixteen bits.
> >   - 105422: Fix a file-rewrite performance case.
> >   - 129545: Implement IO_INVAL in VOP_WRITE() by marking the buffer as
> >     "no cache".
> >   - Readd the DOINGASYNC() macro and use it to control asynchronous writes.
> >     Change i-node updates to honor DOINGASYNC() instead of always being
> >     synchronous.
> >   - Use a PRIV_VFS_RETAINSUGID check instead of checking cr_uid against 0
> >     directly when deciding whether or not to clear suid and sgid bits.
> >   
> >   Submitted by:	Pedro F. Giffuni  giffunip at yahoo
> > 
> 
> > @@ -141,10 +162,42 @@ READ(ap)
> >  		if (error)
> >  			break;
> >  
> > -		bqrelse(bp);
> > +		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
> > +		   (LIST_FIRST(&bp->b_dep) == NULL)) {
> > +			/*
> > +			 * If there are no dependencies, and it's VMIO,
> There is no dependencies for ext2fs, the FFS comments talks about SU.

It looks like Pedro hinted at that in the 3rd place the code tested it.  This
patch should remove the checks assuming they are always true:

Index: ext2_readwrite.c
===================================================================
--- ext2_readwrite.c	(revision 221166)
+++ ext2_readwrite.c	(working copy)
@@ -162,8 +162,7 @@ READ(ap)
 		if (error)
 			break;
 
-		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
-		   (LIST_FIRST(&bp->b_dep) == NULL)) {
+		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			/*
 			 * If there are no dependencies, and it's VMIO,
 			 * then we don't need the buf, mark it available
@@ -189,8 +188,7 @@ READ(ap)
 	 * so it must have come from a 'break' statement
 	 */
 	if (bp != NULL) {
-		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
-		   (LIST_FIRST(&bp->b_dep) == NULL)) {
+		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			bp->b_flags |= B_RELBUF;
 			brelse(bp);
 		} else {
@@ -319,8 +317,7 @@ WRITE(ap)
 
 		error =
 		    uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
-		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
-		   (LIST_EMPTY(&bp->b_dep))) {	/* in ext2fs? */
+		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			bp->b_flags |= B_RELBUF;
 		}
 

> Also, I am unsure what the resulting semantic of O_DIRECTIO for ext2
> is ? UFS tries to eliminate any use of buffer cache for O_DIRECTIO
> case, up to the mapping of user pages into pbuf to perform the
> actual i/o. In ext2 case, it seems we will just destroy the buffers
> after using them for i/o. Is it useful ?

Hmm, I believe Pedro said he did not see a performance change in benchmarks,
but that it was still good to reduce diffs with the UFS code at least.
However, mapping the user pages into the buffer seems mandatory for any
performance gain to be seen.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 17:36:27 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0B18F106564A;
	Thu, 28 Apr 2011 17:36:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EFD298FC0A;
	Thu, 28 Apr 2011 17:36:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SHaQvu032996;
	Thu, 28 Apr 2011 17:36:26 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SHaQhl032994;
	Thu, 28 Apr 2011 17:36:26 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104281736.p3SHaQhl032994@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Apr 2011 17:36:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221176 - head/sys/fs/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 17:36:27 -0000

Author: jhb
Date: Thu Apr 28 17:36:26 2011
New Revision: 221176
URL: http://svn.freebsd.org/changeset/base/221176

Log:
  The b_dep field of buffers is always empty for ext2fs, it is only used
  for SU in FFS.
  
  Reported by:	kib

Modified:
  head/sys/fs/ext2fs/ext2_readwrite.c

Modified: head/sys/fs/ext2fs/ext2_readwrite.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_readwrite.c	Thu Apr 28 16:29:19 2011	(r221175)
+++ head/sys/fs/ext2fs/ext2_readwrite.c	Thu Apr 28 17:36:26 2011	(r221176)
@@ -162,8 +162,7 @@ READ(ap)
 		if (error)
 			break;
 
-		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
-		   (LIST_FIRST(&bp->b_dep) == NULL)) {
+		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			/*
 			 * If there are no dependencies, and it's VMIO,
 			 * then we don't need the buf, mark it available
@@ -189,8 +188,7 @@ READ(ap)
 	 * so it must have come from a 'break' statement
 	 */
 	if (bp != NULL) {
-		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
-		   (LIST_FIRST(&bp->b_dep) == NULL)) {
+		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			bp->b_flags |= B_RELBUF;
 			brelse(bp);
 		} else {
@@ -319,8 +317,7 @@ WRITE(ap)
 
 		error =
 		    uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio);
-		if ((ioflag & (IO_VMIO|IO_DIRECT)) &&
-		   (LIST_EMPTY(&bp->b_dep))) {	/* in ext2fs? */
+		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			bp->b_flags |= B_RELBUF;
 		}
 

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 17:44:24 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 850CC106564A;
	Thu, 28 Apr 2011 17:44:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A42A8FC0A;
	Thu, 28 Apr 2011 17:44:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SHiOAR033276;
	Thu, 28 Apr 2011 17:44:24 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SHiOT9033271;
	Thu, 28 Apr 2011 17:44:24 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104281744.p3SHiOT9033271@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Apr 2011 17:44:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221177 - in head/sys/boot/i386: boot2 common zfsboot
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 17:44:24 -0000

Author: jhb
Date: Thu Apr 28 17:44:24 2011
New Revision: 221177
URL: http://svn.freebsd.org/changeset/base/221177

Log:
  Due to space constraints, the UFS boot2 and boot1 use an evil hack where
  boot2 calls back into boot1 to perform disk reads.  The ZFS MBR boot blocks
  do not have the same space constraints, so remove this hack for ZFS.
  While here, remove commented out code to support C/H/S addressing from
  zfsldr.  The ZFS and GPT bootstraps always just use EDD LBA addressing.
  
  MFC after:	2 weeks

Modified:
  head/sys/boot/i386/boot2/Makefile
  head/sys/boot/i386/common/drv.c
  head/sys/boot/i386/zfsboot/Makefile
  head/sys/boot/i386/zfsboot/zfsldr.S

Modified: head/sys/boot/i386/boot2/Makefile
==============================================================================
--- head/sys/boot/i386/boot2/Makefile	Thu Apr 28 17:36:26 2011	(r221176)
+++ head/sys/boot/i386/boot2/Makefile	Thu Apr 28 17:44:24 2011	(r221177)
@@ -32,6 +32,7 @@ CFLAGS=	-Os \
 	-mno-align-long-strings \
 	-mrtd \
 	-mregparm=3 \
+	-DUSE_XREAD \
 	-D${BOOT2_UFS} \
 	-DFLAGS=${BOOT_BOOT1_FLAGS} \
 	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \

Modified: head/sys/boot/i386/common/drv.c
==============================================================================
--- head/sys/boot/i386/common/drv.c	Thu Apr 28 17:36:26 2011	(r221176)
+++ head/sys/boot/i386/common/drv.c	Thu Apr 28 17:44:24 2011	(r221177)
@@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$");
 #include "rbx.h"
 #include "util.h"
 #include "drv.h"
-#ifndef GPT
+#ifdef USE_XREAD
 #include "xreadorg.h"
 #endif
 
@@ -58,7 +58,7 @@ drvsize(struct dsk *dskp)
 }
 #endif	/* GPT */
 
-#ifdef GPT
+#ifndef USE_XREAD
 static struct {
 	uint16_t	len;
 	uint16_t	count;
@@ -66,7 +66,7 @@ static struct {
 	uint16_t	seg;
 	uint64_t	lba;
 } packet;
-#endif	/* GPT */
+#endif
 
 int
 drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk)
@@ -75,7 +75,7 @@ drvread(struct dsk *dskp, void *buf, dad
 
 	if (!OPT_CHECK(RBX_QUIET))
 		printf("%c\b", c = c << 8 | c >> 24);
-#ifdef GPT
+#ifndef USE_XREAD
 	packet.len = 0x10;
 	packet.count = nblk;
 	packet.off = VTOPOFF(buf);
@@ -87,7 +87,7 @@ drvread(struct dsk *dskp, void *buf, dad
 	v86.edx = dskp->drive;
 	v86.ds = VTOPSEG(&packet);
 	v86.esi = VTOPOFF(&packet);
-#else	/* !GPT */
+#else	/* USE_XREAD */
 	v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS;
 	v86.addr = XREADORG;		/* call to xread in boot1 */
 	v86.es = VTOPSEG(buf);
@@ -95,7 +95,7 @@ drvread(struct dsk *dskp, void *buf, dad
 	v86.ebx = VTOPOFF(buf);
 	v86.ecx = lba >> 32;
 	v86.edx = nblk << 8 | dskp->drive;
-#endif	/* !GPT */
+#endif	/* USE_XREAD */
 	v86int();
 	if (V86_CY(v86.efl)) {
 		printf("%s: error %u lba %u\n",

Modified: head/sys/boot/i386/zfsboot/Makefile
==============================================================================
--- head/sys/boot/i386/zfsboot/Makefile	Thu Apr 28 17:36:26 2011	(r221176)
+++ head/sys/boot/i386/zfsboot/Makefile	Thu Apr 28 17:44:24 2011	(r221177)
@@ -6,9 +6,6 @@ FILES=		zfsboot
 
 NM?=		nm
 
-# A value of 0x80 enables LBA support.
-BOOT_BOOT1_FLAGS?=	0x80
-
 BOOT_COMCONSOLE_PORT?= 0x3f8
 BOOT_COMCONSOLE_SPEED?= 9600
 B2SIOFMT?=	0x3
@@ -25,7 +22,6 @@ CFLAGS=	-DBOOTPROG=\"zfsboot\" \
 	-mno-align-long-strings \
 	-mrtd \
 	-DBOOT2 \
-	-DFLAGS=${BOOT_BOOT1_FLAGS} \
 	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
 	-DSIOFMT=${B2SIOFMT} \
 	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
@@ -64,8 +60,7 @@ zfsldr.out: zfsldr.o
 	${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
 
 CLEANFILES+=	zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
-		zfsboot.o zfsboot.s zfsboot.s.tmp xreadorg.h sio.o cons.o \
-		drv.o util.o
+		zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o
 
 # We currently allow 65536 bytes for zfsboot - in practice it could be
 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
@@ -92,20 +87,13 @@ zfsboot.out: ${BTXCRT} zfsboot.o sio.o d
 
 zfsboot.o: zfsboot.s
 
-SRCS=	zfsboot.c xreadorg.h
+SRCS=	zfsboot.c
 
-zfsboot.s: zfsboot.c xreadorg.h ${.CURDIR}/../../zfs/zfsimpl.c
+zfsboot.s: zfsboot.c ${.CURDIR}/../../zfs/zfsimpl.c
 	${CC} ${CFLAGS} -S -o zfsboot.s.tmp ${.CURDIR}/zfsboot.c
 	sed -e '/align/d' -e '/nop/d' < zfsboot.s.tmp > zfsboot.s
 	rm -f zfsboot.s.tmp
 
-xreadorg.h: zfsldr.out
-	${NM} -t d ${.ALLSRC} | awk '/([0-9])+ T xread/ \
-	    { x = $$1 - ORG1; \
-	    printf("#define XREADORG %#x\n", REL1 + x) }' \
-	    ORG1=`printf "%d" ${ORG1}` \
-	    REL1=`printf "%d" ${REL1}` > ${.TARGET}
-
 .if ${MACHINE_CPUARCH} == "amd64"
 beforedepend zfsboot.s: machine
 CLEANFILES+=	machine

Modified: head/sys/boot/i386/zfsboot/zfsldr.S
==============================================================================
--- head/sys/boot/i386/zfsboot/zfsldr.S	Thu Apr 28 17:36:26 2011	(r221176)
+++ head/sys/boot/i386/zfsboot/zfsldr.S	Thu Apr 28 17:44:24 2011	(r221177)
@@ -30,16 +30,12 @@
 		.set PRT_NUM,0x4		# Partitions
 		.set PRT_BSD,0xa5		# Partition type
 
-/* Flag Bits */
-		.set FL_PACKET,0x80		# Packet mode
-
 /* Misc. Constants */
 		.set SIZ_PAG,0x1000		# Page size
 		.set SIZ_SEC,0x200		# Sector size
 
 		.set NSECT,0x80
 		.globl start
-		.globl xread
 		.code16
 
 start:		jmp main			# Start recognizably
@@ -49,7 +45,7 @@ start:		jmp main			# Start recognizably
  * FAT disks have this at the start of their MBR. While normal BIOS's will
  * work fine without this section, IBM's El Torito emulation "fixes" up the
  * BPB by writing into the memory copy of the MBR. Rather than have data
- * written into our xread routine, we'll define a BPB to work around it.
+ * written into our code, we'll define a BPB to work around it.
  * The data marked with (T) indicates a field required for a ThinkPad to
  * recognize the disk and (W) indicates fields written from IBM BIOS code.
  * The use of the BPB is based on what OpenBSD and NetBSD implemented in
@@ -80,34 +76,7 @@ ebpb:		.byte	0		# BIOS physical drive nu
 
 		.org 0x25,0x90
 /*
- * Trampoline used by boot2 to call read to read data from the disk via
- * the BIOS.  Call with:
- *
- * %ecx:%eax	- long    - LBA to read in
- * %es:(%bx)	- caddr_t - buffer to read data into
- * %dl		- byte    - drive to read from
- * %dh		- byte    - num sectors to read
- */
-
-xread:		push %ss			# Address
-		pop %ds				#  data
-/*
- * Setup an EDD disk packet and pass it to read
- */
-xread.1:	pushl %ecx			# Starting absolute block
-		pushl %eax			#  block number
-		push %es			# Address of
-		push %bx			#  transfer buffer
-		xor %ax,%ax			# Number of
-		movb %dh,%al			#  blocks to
-		push %ax			#  transfer
-		push $0x10			# Size of packet
-		mov %sp,%bp			# Packet pointer
-		callw read			# Read from disk
-		lea 0x10(%bp),%sp		# Clear stack
-		lret				# To far caller
-/*
- * Load the rest of boot2 and BTX up, copy the parts to the right locations,
+ * Load the rest of zfsboot2 and BTX up, copy the parts to the right locations,
  * and start it all up.
  */
 
@@ -181,7 +150,7 @@ main.4: 	xor %dx,%dx			# Partition:drive
  * itself to 0x9000 - doing it in this order means that none of the
  * memcpy regions overlap which would corrupt the copy.  Normally, BTX
  * clients start at MEM_USR, or 0xa000, but when we use btxld to
- * create boot2, we use an entry point of 0x2000.  That entry point is
+ * create zfsboot2, we use an entry point of 0x2000.  That entry point is
  * relative to MEM_USR; thus boot2.bin starts at 0xc000.
  *
  * The load area and the target area for the client overlap so we have
@@ -241,15 +210,29 @@ seta20.3:	sti				# Enable interrupts
 
 
 /*
- * Trampoline used to call read from within boot1.
+ * Trampoline used to call read from within zfsldr.  Sets up an EDD
+ * packet on the stack and passes it to read.
+ *
+ * %eax		- int     - LBA to read in relative to partition start
+ * %dl		- byte    - drive to read from
+ * %dh		- byte    - num sectors to read
+ * %si		- ptr     - MBR partition entry
  */
 nread:		xor %eax,%eax			# Sector offset in partition
-nread.1:	mov $MEM_BUF,%bx		# Transfer buffer
-		xor %ecx,%ecx			# Get
+nread.1:	xor %ecx,%ecx			# Get
 		addl 0x8(%si),%eax		#  LBA
 		adc $0,%ecx
-		push %cs			# Read from
-		callw xread.1	 		#  disk
+		pushl %ecx			# Starting absolute block
+		pushl %eax			#  block number
+		push %es			# Address of
+		push $MEM_BUF			#  transfer buffer
+		xor %ax,%ax			# Number of
+		movb %dh,%al			#  blocks to
+		push %ax			#  transfer
+		push $0x10			# Size of packet
+		mov %sp,%bp			# Packet pointer
+		callw read			# Read from disk
+		lea 0x10(%bp),%sp		# Clear stack
 		jnc return			# If success, return
 		mov $msg_read,%si		# Otherwise, set the error
 						#  message and fall through to
@@ -293,9 +276,7 @@ return: 	retw				# To caller
  * %dl	- byte     - drive number
  * stack - 10 bytes - EDD Packet
  */
-read:		testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled?
-		jz read.1			# No, use CHS
-		cmpb $0x80,%dl			# Hard drive?
+read:		cmpb $0x80,%dl			# Hard drive?
 		jb read.1			# No, use CHS
 		mov $0x55aa,%bx			# Magic
 		push %dx			# Save
@@ -311,73 +292,9 @@ read:		testb $FL_PACKET,%cs:MEM_REL+flag
 		movb $0x42,%ah			# BIOS: Extended
 		int $0x13			#  read
 		retw				# To caller
-#if 0	
-read.1:	 	push %dx			# Save
-		movb $0x8,%ah			# BIOS: Get drive
-		int $0x13			#  parameters
-		movb %dh,%ch			# Max head number
-		pop %dx				# Restore
-		jc return			# If error
-		andb $0x3f,%cl			# Sectors per track
-		jz ereturn			# If zero
-		cli				# Disable interrupts
-		mov 0x8(%bp),%eax		# Get LBA
-		push %dx			# Save
-		movzbl %cl,%ebx			# Divide by
-		xor %edx,%edx			#  sectors
-		div %ebx			#  per track
-		movb %ch,%bl			# Max head number
-		movb %dl,%ch			# Sector number
-		inc %bx				# Divide by
-		xorb %dl,%dl			#  number
-		div %ebx			#  of heads
-		movb %dl,%bh			# Head number
-		pop %dx				# Restore
-		cmpl $0x3ff,%eax		# Cylinder number supportable?
-		sti				# Enable interrupts
-		ja ereturn			# No, return an error
-		xchgb %al,%ah			# Set up cylinder
-		rorb $0x2,%al			#  number
-		orb %ch,%al			# Merge
-		inc %ax				#  sector
-		xchg %ax,%cx	 		#  number
-		movb %bh,%dh			# Head number
-		subb %ah,%al			# Sectors this track
-		mov 0x2(%bp),%ah		# Blocks to read
-		cmpb %ah,%al			# To read
-		jb read.2			#  this
-#ifdef	TRACK_AT_A_TIME
-		movb %ah,%al			#  track
-#else
-		movb $1,%al			#  one sector
-#endif
-read.2: 	mov $0x5,%di	 		# Try count
-read.3: 	les 0x4(%bp),%bx		# Transfer buffer
-		push %ax			# Save
-		movb $0x2,%ah			# BIOS: Read
-		int $0x13			#  from disk
-		pop %bx				# Restore
-		jnc read.4			# If success
-		dec %di				# Retry?
-		jz read.6			# No
-		xorb %ah,%ah			# BIOS: Reset
-		int $0x13			#  disk system
-		xchg %bx,%ax	 		# Block count
-		jmp read.3			# Continue
-read.4: 	movzbw %bl,%ax	 		# Sectors read
-		add %ax,0x8(%bp)		# Adjust
-		jnc read.5			#  LBA,
-		incw 0xa(%bp)	 		#  transfer
-read.5: 	shlb %bl			#  buffer
-		add %bl,0x5(%bp)		#  pointer,
-		sub %al,0x2(%bp)		#  block count
-		ja read.1			# If not done
-read.6: 	retw				# To caller
-#else
 read.1:		mov $msg_chs,%si
 		jmp error
 msg_chs:	.asciz "CHS not supported"
-#endif
 
 /* Messages */
 
@@ -386,8 +303,6 @@ msg_part:	.asciz "Boot"
 
 prompt: 	.asciz " error\r\n"
 
-flags:		.byte FLAGS			# Flags
-
 		.org PRT_OFF,0x90
 
 /* Partition table */

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 17:56:02 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 626B91065670;
	Thu, 28 Apr 2011 17:56:02 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 523DE8FC08;
	Thu, 28 Apr 2011 17:56:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SHu2Yt035012;
	Thu, 28 Apr 2011 17:56:02 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SHu2MS035010;
	Thu, 28 Apr 2011 17:56:02 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201104281756.p3SHu2MS035010@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 28 Apr 2011 17:56:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221178 - head/sys/x86/x86
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 17:56:02 -0000

Author: jkim
Date: Thu Apr 28 17:56:02 2011
New Revision: 221178
URL: http://svn.freebsd.org/changeset/base/221178

Log:
  Turn off periodic recalibration of CPU ticker frequency if it is invariant.

Modified:
  head/sys/x86/x86/tsc.c

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Thu Apr 28 17:44:24 2011	(r221177)
+++ head/sys/x86/x86/tsc.c	Thu Apr 28 17:56:02 2011	(r221178)
@@ -228,7 +228,7 @@ init_TSC(void)
 	 * discovers a new max frequency.
 	 */
 	if (tsc_freq != 0)
-		set_cputicker(rdtsc, tsc_freq, 1);
+		set_cputicker(rdtsc, tsc_freq, !tsc_is_invariant);
 
 	if (tsc_is_invariant)
 		return;

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 17:59:34 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C0EC1065674;
	Thu, 28 Apr 2011 17:59:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4BAD18FC1A;
	Thu, 28 Apr 2011 17:59:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SHxYE5035809;
	Thu, 28 Apr 2011 17:59:34 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SHxY1L035806;
	Thu, 28 Apr 2011 17:59:34 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104281759.p3SHxY1L035806@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Apr 2011 17:59:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221179 - in head/sys: ddb dev/usb/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 17:59:34 -0000

Author: jhb
Date: Thu Apr 28 17:59:33 2011
New Revision: 221179
URL: http://svn.freebsd.org/changeset/base/221179

Log:
  Trim some additional unnecessary  includes.
  
  MFC after:	1 week

Modified:
  head/sys/ddb/db_ps.c
  head/sys/dev/usb/net/if_mos.c

Modified: head/sys/ddb/db_ps.c
==============================================================================
--- head/sys/ddb/db_ps.c	Thu Apr 28 17:56:02 2011	(r221178)
+++ head/sys/ddb/db_ps.c	Thu Apr 28 17:59:33 2011	(r221179)
@@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

Modified: head/sys/dev/usb/net/if_mos.c
==============================================================================
--- head/sys/dev/usb/net/if_mos.c	Thu Apr 28 17:56:02 2011	(r221178)
+++ head/sys/dev/usb/net/if_mos.c	Thu Apr 28 17:59:33 2011	(r221179)
@@ -104,7 +104,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 19:19:25 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A5980106566B;
	Thu, 28 Apr 2011 19:19:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 936D08FC12;
	Thu, 28 Apr 2011 19:19:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SJJPej051954;
	Thu, 28 Apr 2011 19:19:25 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SJJPK4051952;
	Thu, 28 Apr 2011 19:19:25 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104281919.p3SJJPK4051952@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Apr 2011 19:19:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221182 - head/sys/dev/puc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 19:19:25 -0000

Author: jhb
Date: Thu Apr 28 19:19:25 2011
New Revision: 221182
URL: http://svn.freebsd.org/changeset/base/221182

Log:
  Add support for Oxford PCI Express Expresso family devices.
  For these devices, the number of supported ports is read from a register
  in BAR 0.
  
  PR:		kern/134878
  Submitted by:	David Wood  david of wood2 org uk
  MFC after:	1 week

Modified:
  head/sys/dev/puc/pucdata.c

Modified: head/sys/dev/puc/pucdata.c
==============================================================================
--- head/sys/dev/puc/pucdata.c	Thu Apr 28 19:08:31 2011	(r221181)
+++ head/sys/dev/puc/pucdata.c	Thu Apr 28 19:19:25 2011	(r221182)
@@ -56,6 +56,7 @@ static puc_config_f puc_config_syba;
 static puc_config_f puc_config_siig;
 static puc_config_f puc_config_timedia;
 static puc_config_f puc_config_titan;
+static puc_config_f puc_config_oxford_pcie;
 
 const struct puc_cfg puc_pci_devices[] = {
 
@@ -619,7 +620,7 @@ const struct puc_cfg puc_pci_devices[] =
 	 * Boards with an Oxford Semiconductor chip.
 	 *
 	 * Oxford Semiconductor provides documentation for their chip at:
-	 * 
+	 * 
 	 *
 	 * As sold by Kouwell .
 	 * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports.
@@ -679,6 +680,63 @@ const struct puc_cfg puc_pci_devices[] =
 	    PUC_PORT_4S, 0x10, 0, 8,
 	},
 
+	/*
+	 * Oxford Semiconductor PCI Express Expresso family
+	 *
+	 * Found in many 'native' PCI Express serial boards such as:
+	 *
+	 * eMegatech MP954ER4 (4 port) and MP958ER8 (8 port)
+	 * 
+	 *
+	 * Lindy 51189 (4 port)
+	 *  
+	 * 
+	 * StarTech.com PEX4S952 (4 port) and PEX8S952 (8 port)
+	 * 
+	 */
+
+	{   0x1415, 0xc158, 0xffff, 0,
+	    "Oxford Semiconductor OXPCIe952 UARTs",
+	    DEFAULT_RCLK * 0x22,
+	    PUC_PORT_NONSTANDARD, 0x10, 0, -1,
+	    .config_function = puc_config_oxford_pcie
+	},
+
+	{   0x1415, 0xc15d, 0xffff, 0,
+	    "Oxford Semiconductor OXPCIe952 UARTs (function 1)",
+	    DEFAULT_RCLK * 0x22,
+	    PUC_PORT_NONSTANDARD, 0x10, 0, -1,
+	    .config_function = puc_config_oxford_pcie
+	},
+
+	{   0x1415, 0xc208, 0xffff, 0,
+	    "Oxford Semiconductor OXPCIe954 UARTs",
+	    DEFAULT_RCLK * 0x22,
+	    PUC_PORT_NONSTANDARD, 0x10, 0, -1,
+	    .config_function = puc_config_oxford_pcie
+	},
+
+	{   0x1415, 0xc20d, 0xffff, 0,
+	    "Oxford Semiconductor OXPCIe954 UARTs (function 1)",
+	    DEFAULT_RCLK * 0x22,
+	    PUC_PORT_NONSTANDARD, 0x10, 0, -1,
+	    .config_function = puc_config_oxford_pcie
+	},
+
+	{   0x1415, 0xc308, 0xffff, 0,
+	    "Oxford Semiconductor OXPCIe958 UARTs",
+	    DEFAULT_RCLK * 0x22,
+	    PUC_PORT_NONSTANDARD, 0x10, 0, -1,
+	    .config_function = puc_config_oxford_pcie
+	},
+
+	{   0x1415, 0xc30d, 0xffff, 0,
+	    "Oxford Semiconductor OXPCIe958 UARTs (function 1)",
+	    DEFAULT_RCLK * 0x22,
+	    PUC_PORT_NONSTANDARD, 0x10, 0, -1,
+	    .config_function = puc_config_oxford_pcie
+	},
+
 	{   0x14d2, 0x8010, 0xffff, 0,
 	    "VScom PCI-100L",
 	    DEFAULT_RCLK * 8,
@@ -1253,6 +1311,81 @@ puc_config_timedia(struct puc_softc *sc,
 }
 
 static int
+puc_config_oxford_pcie(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
+    intptr_t *res)
+{
+	const struct puc_cfg *cfg = sc->sc_cfg;
+	int idx;
+	struct puc_bar *bar;
+	uint8_t value;
+
+	switch (cmd) {
+	case PUC_CFG_SETUP:
+		device_printf(sc->sc_dev, "%d UARTs detected\n",
+			sc->sc_nports);
+
+		/* Set UARTs to enhanced mode */
+		bar = puc_get_bar(sc, cfg->rid);
+		if (bar == NULL)
+			return (ENXIO);
+
+		for (idx = 0; idx < sc->sc_nports; idx++) {
+			value = bus_read_1(bar->b_res, 0x1000 + (idx << 9)
+				+ 0x92);
+			bus_write_1(bar->b_res, 0x1000 + (idx << 9) + 0x92,
+				value | 0x10);
+		}
+
+		return (0);
+	case PUC_CFG_GET_LEN:
+		*res = 0x200;
+		return (0);
+	case PUC_CFG_GET_NPORTS:
+		/*
+		 * Check if we are being called from puc_bfe_attach()
+		 * or puc_bfe_probe(). If puc_bfe_probe(), we cannot
+		 * puc_get_bar(), so we return a value of 16. This has cosmetic
+		 * side-effects at worst; in PUC_CFG_GET_DESC,
+		 * (int)sc->sc_cfg_data will not contain the true number of
+		 * ports in PUC_CFG_GET_DESC, but we are not implementing that
+		 * call for this device family anyway.
+		 *
+		 * The check is for initialisation of sc->sc_bar[idx], which is
+		 * only done in puc_bfe_attach().
+		 */
+		idx = 0;
+		do {
+			if (sc->sc_bar[idx++].b_rid != -1) {
+				sc->sc_cfg_data = 16;
+				*res = sc->sc_cfg_data;
+				return (0);
+			}
+		} while (idx < PUC_PCI_BARS);
+
+		bar = puc_get_bar(sc, cfg->rid);
+		if (bar == NULL)
+			return (ENXIO);
+
+		value = bus_read_1(bar->b_res, 0x04);
+		if (value == 0)
+			return (ENXIO);
+
+		sc->sc_cfg_data = value;
+		*res = sc->sc_cfg_data;
+		return (0);
+	case PUC_CFG_GET_OFS:
+		*res = 0x1000 + (port << 9);
+		return (0);
+	case PUC_CFG_GET_TYPE:
+		*res = PUC_TYPE_SERIAL;
+		return (0);
+	default:
+		break;
+	}
+	return (ENXIO);
+}
+
+static int
 puc_config_titan(struct puc_softc *sc, enum puc_cfg_cmd cmd, int port,
     intptr_t *res)
 {

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 20:25:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 47D08106566C;
	Thu, 28 Apr 2011 20:25:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 36B5C8FC15;
	Thu, 28 Apr 2011 20:25:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SKPGBN057786;
	Thu, 28 Apr 2011 20:25:16 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SKPGmm057784;
	Thu, 28 Apr 2011 20:25:16 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104282025.p3SKPGmm057784@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 28 Apr 2011 20:25:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221183 - head/sys/fs/ext2fs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 20:25:16 -0000

Author: jhb
Date: Thu Apr 28 20:25:15 2011
New Revision: 221183
URL: http://svn.freebsd.org/changeset/base/221183

Log:
  Update a comment since ext2fs does not use SU.
  
  Reviewed by:	kib

Modified:
  head/sys/fs/ext2fs/ext2_readwrite.c

Modified: head/sys/fs/ext2fs/ext2_readwrite.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_readwrite.c	Thu Apr 28 19:19:25 2011	(r221182)
+++ head/sys/fs/ext2fs/ext2_readwrite.c	Thu Apr 28 20:25:15 2011	(r221183)
@@ -164,9 +164,9 @@ READ(ap)
 
 		if (ioflag & (IO_VMIO|IO_DIRECT)) {
 			/*
-			 * If there are no dependencies, and it's VMIO,
-			 * then we don't need the buf, mark it available
-			 * for freeing. The VM has the data.
+			 * If it's VMIO or direct I/O, then we don't
+			 * need the buf, mark it available for
+			 * freeing. If it's VMIO, the VM has the data.
 			 */
 			bp->b_flags |= B_RELBUF;
 			brelse(bp);

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 22:21:54 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 348C51065672;
	Thu, 28 Apr 2011 22:21:54 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2525B8FC14;
	Thu, 28 Apr 2011 22:21:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SMLsRh068510;
	Thu, 28 Apr 2011 22:21:54 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SMLs5M068508;
	Thu, 28 Apr 2011 22:21:54 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201104282221.p3SMLs5M068508@svn.freebsd.org>
From: Jack F Vogel 
Date: Thu, 28 Apr 2011 22:21:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221187 - head/sys/dev/e1000
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 22:21:54 -0000

Author: jfv
Date: Thu Apr 28 22:21:53 2011
New Revision: 221187
URL: http://svn.freebsd.org/changeset/base/221187

Log:
  Small change to make backporting to stable/7,
  thanks to Arnaud Lacombe for suggesting it.

Modified:
  head/sys/dev/e1000/if_igb.h

Modified: head/sys/dev/e1000/if_igb.h
==============================================================================
--- head/sys/dev/e1000/if_igb.h	Thu Apr 28 21:41:00 2011	(r221186)
+++ head/sys/dev/e1000/if_igb.h	Thu Apr 28 22:21:53 2011	(r221187)
@@ -524,7 +524,7 @@ igb_rx_unrefreshed(struct rx_ring *rxr)
 	cur |= new;				\
 }
 
-#if __FreeBSD_version < 800504
+#if __FreeBSD_version >= 800000 && __FreeBSD_version < 800504
 static __inline int
 drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br)
 {

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 22:23:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B3C81106566C;
	Thu, 28 Apr 2011 22:23:39 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 892738FC0C;
	Thu, 28 Apr 2011 22:23:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SMNdnt068708;
	Thu, 28 Apr 2011 22:23:39 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SMNdeJ068703;
	Thu, 28 Apr 2011 22:23:39 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201104282223.p3SMNdeJ068703@svn.freebsd.org>
From: Jung-uk Kim 
Date: Thu, 28 Apr 2011 22:23:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221188 - in head/sys: amd64/amd64 amd64/include
	i386/i386 i386/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 22:23:39 -0000

Author: jkim
Date: Thu Apr 28 22:23:39 2011
New Revision: 221188
URL: http://svn.freebsd.org/changeset/base/221188

Log:
  Define "Hypervisor Present" bit.  This bit is used by several hypervisors to
  identify CPUs running under emulation.  Currently QEMU-KVM, Xen-HVM, VMware,
  and MS Hyper-V are known to set this bit.
  
  MFC after:	3 days

Modified:
  head/sys/amd64/amd64/identcpu.c
  head/sys/amd64/include/specialreg.h
  head/sys/i386/i386/identcpu.c
  head/sys/i386/include/specialreg.h

Modified: head/sys/amd64/amd64/identcpu.c
==============================================================================
--- head/sys/amd64/amd64/identcpu.c	Thu Apr 28 22:21:53 2011	(r221187)
+++ head/sys/amd64/amd64/identcpu.c	Thu Apr 28 22:23:39 2011	(r221188)
@@ -296,7 +296,7 @@ printcpuinfo(void)
 				"\035"
 				"\036"
 				"\037"
-				"\040"
+				"\040HV"	/* Hypervisor */
 				);
 			}
 

Modified: head/sys/amd64/include/specialreg.h
==============================================================================
--- head/sys/amd64/include/specialreg.h	Thu Apr 28 22:21:53 2011	(r221187)
+++ head/sys/amd64/include/specialreg.h	Thu Apr 28 22:23:39 2011	(r221188)
@@ -134,6 +134,7 @@
 #define	CPUID2_MOVBE	0x00400000
 #define	CPUID2_POPCNT	0x00800000
 #define	CPUID2_AESNI	0x02000000
+#define	CPUID2_HV	0x80000000
 
 /*
  * Important bits in the Thermal and Power Management flags

Modified: head/sys/i386/i386/identcpu.c
==============================================================================
--- head/sys/i386/i386/identcpu.c	Thu Apr 28 22:21:53 2011	(r221187)
+++ head/sys/i386/i386/identcpu.c	Thu Apr 28 22:23:39 2011	(r221188)
@@ -773,7 +773,7 @@ printcpuinfo(void)
 				"\035"
 				"\036"
 				"\037"
-				"\040"
+				"\040HV"	/* Hypervisor */
 				);
 			}
 

Modified: head/sys/i386/include/specialreg.h
==============================================================================
--- head/sys/i386/include/specialreg.h	Thu Apr 28 22:21:53 2011	(r221187)
+++ head/sys/i386/include/specialreg.h	Thu Apr 28 22:23:39 2011	(r221188)
@@ -131,6 +131,7 @@
 #define	CPUID2_MOVBE	0x00400000
 #define	CPUID2_POPCNT	0x00800000
 #define	CPUID2_AESNI	0x02000000
+#define	CPUID2_HV	0x80000000
 
 /*
  * Important bits in the Thermal and Power Management flags

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 23:21:40 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6EA4106564A;
	Thu, 28 Apr 2011 23:21:40 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D85A78FC0C;
	Thu, 28 Apr 2011 23:21:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SNLe1a072853;
	Thu, 28 Apr 2011 23:21:40 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SNLeVD072851;
	Thu, 28 Apr 2011 23:21:40 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201104282321.p3SNLeVD072851@svn.freebsd.org>
From: Jack F Vogel 
Date: Thu, 28 Apr 2011 23:21:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221189 - head/sys/dev/ixgbe
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 23:21:41 -0000

Author: jfv
Date: Thu Apr 28 23:21:40 2011
New Revision: 221189
URL: http://svn.freebsd.org/changeset/base/221189

Log:
  Add a #define for driver portability to older OS

Modified:
  head/sys/dev/ixgbe/ixgbe.h

Modified: head/sys/dev/ixgbe/ixgbe.h
==============================================================================
--- head/sys/dev/ixgbe/ixgbe.h	Thu Apr 28 22:23:39 2011	(r221188)
+++ head/sys/dev/ixgbe/ixgbe.h	Thu Apr 28 23:21:40 2011	(r221189)
@@ -154,6 +154,11 @@
 #define IXGBE_FC_HI		0x20000
 #define IXGBE_FC_LO		0x10000
 
+/* Keep older OS drivers building... */
+#if !defined(SYSCTL_ADD_UQUAD)
+#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD
+#endif
+
 /* Defines for printing debug information */
 #define DEBUG_INIT  0
 #define DEBUG_IOCTL 0

From owner-svn-src-head@FreeBSD.ORG  Thu Apr 28 23:21:51 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2914B106578E;
	Thu, 28 Apr 2011 23:21:51 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 15E648FC12;
	Thu, 28 Apr 2011 23:21:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3SNLo2A072893;
	Thu, 28 Apr 2011 23:21:50 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3SNLopx072891;
	Thu, 28 Apr 2011 23:21:50 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104282321.p3SNLopx072891@svn.freebsd.org>
From: Rick Macklem 
Date: Thu, 28 Apr 2011 23:21:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221190 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Thu, 28 Apr 2011 23:21:51 -0000

Author: rmacklem
Date: Thu Apr 28 23:21:50 2011
New Revision: 221190
URL: http://svn.freebsd.org/changeset/base/221190

Log:
  Fix the new NFS client so that it handles the "nfs_args" value
  in mnt_optnew. This is needed so that the old mount(2) syscall
  works and that is needed so that amd(8) works. The code was
  basically just cribbed from sys/nfsclient/nfs_vfsops.c with minor
  changes. This patch is mainly to fix the new NFS client so that
  amd(8) works with it. Thanks go to Craig Rodrigues for helping with
  this.
  
  Tested by:	Craig Rodrigues (for amd)
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvfsops.c

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Thu Apr 28 23:21:40 2011	(r221189)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Thu Apr 28 23:21:50 2011	(r221190)
@@ -708,7 +708,7 @@ nfs_decode_args(struct mount *mp, struct
 	}
 }
 
-static const char *nfs_opts[] = { "from",
+static const char *nfs_opts[] = { "from", "nfs_args",
     "noatime", "noexec", "suiddir", "nosuid", "nosymfollow", "union",
     "noclusterr", "noclusterw", "multilabel", "acls", "force", "update",
     "async", "noconn", "nolockd", "conn", "lockd", "intr", "rdirplus",
@@ -762,8 +762,9 @@ nfs_mount(struct mount *mp)
 	u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100];
 	char *opt, *name, *secname;
 	int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO;
-	int dirlen, krbnamelen, srvkrbnamelen;
+	int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen;
 
+	has_nfs_args_opt = 0;
 	if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
 		error = EINVAL;
 		goto out;
@@ -777,6 +778,25 @@ nfs_mount(struct mount *mp)
 
 	nfscl_init();
 
+	/*
+	 * The old mount_nfs program passed the struct nfs_args
+	 * from userspace to kernel.  The new mount_nfs program
+	 * passes string options via nmount() from userspace to kernel
+	 * and we populate the struct nfs_args in the kernel.
+	 */
+	if (vfs_getopt(mp->mnt_optnew, "nfs_args", NULL, NULL) == 0) {
+		error = vfs_copyopt(mp->mnt_optnew, "nfs_args", &args,
+		    sizeof(args));
+		if (error != 0)
+			goto out;
+
+		if (args.version != NFS_ARGSVERSION) {
+			error = EPROGMISMATCH;
+			goto out;
+		}
+		has_nfs_args_opt = 1;
+	}
+
 	/* Handle the new style options. */
 	if (vfs_getopt(mp->mnt_optnew, "noconn", NULL, NULL) == 0)
 		args.flags |= NFSMNT_NOCONN;
@@ -993,27 +1013,52 @@ nfs_mount(struct mount *mp)
 	if (nfs_ip_paranoia == 0)
 		args.flags |= NFSMNT_NOCONN;
 
-	if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh,
-	    &args.fhsize) == 0) {
-		if (args.fhsize < 0 || args.fhsize > NFSX_FHMAX) {
+	if (has_nfs_args_opt != 0) {
+		/*
+		 * In the 'nfs_args' case, the pointers in the args
+		 * structure are in userland - we copy them in here.
+		 */
+		if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX) {
 			vfs_mount_error(mp, "Bad file handle");
 			error = EINVAL;
 			goto out;
 		}
-		bcopy(args.fh, nfh, args.fhsize);
+		error = copyin((caddr_t)args.fh, (caddr_t)nfh,
+		    args.fhsize);
+		if (error != 0)
+			goto out;
+		error = copyinstr(args.hostname, hst, MNAMELEN - 1, &len);
+		if (error != 0)
+			goto out;
+		bzero(&hst[len], MNAMELEN - len);
+		args.hostname = hst;
+		/* sockargs() call must be after above copyin() calls */
+		error = getsockaddr(&nam, (caddr_t)args.addr,
+		    args.addrlen);
+		if (error != 0)
+			goto out;
 	} else {
-		args.fhsize = 0;
-	}
-
-	(void) vfs_getopt(mp->mnt_optnew, "hostname", (void **)&args.hostname,
-	    &len);
-	if (args.hostname == NULL) {
-		vfs_mount_error(mp, "Invalid hostname");
-		error = EINVAL;
-		goto out;
+		if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh,
+		    &args.fhsize) == 0) {
+			if (args.fhsize < 0 || args.fhsize > NFSX_FHMAX) {
+				vfs_mount_error(mp, "Bad file handle");
+				error = EINVAL;
+				goto out;
+			}
+			bcopy(args.fh, nfh, args.fhsize);
+		} else {
+			args.fhsize = 0;
+		}
+		(void) vfs_getopt(mp->mnt_optnew, "hostname",
+		    (void **)&args.hostname, &len);
+		if (args.hostname == NULL) {
+			vfs_mount_error(mp, "Invalid hostname");
+			error = EINVAL;
+			goto out;
+		}
+		bcopy(args.hostname, hst, MNAMELEN);
+		hst[MNAMELEN - 1] = '\0';
 	}
-	bcopy(args.hostname, hst, MNAMELEN);
-	hst[MNAMELEN - 1] = '\0';
 
 	if (vfs_getopt(mp->mnt_optnew, "principal", (void **)&name, NULL) == 0)
 		strlcpy(srvkrbname, name, sizeof (srvkrbname));
@@ -1033,8 +1078,8 @@ nfs_mount(struct mount *mp)
 		dirpath[0] = '\0';
 	dirlen = strlen(dirpath);
 
-	if (vfs_getopt(mp->mnt_optnew, "addr", (void **)&args.addr,
-	    &args.addrlen) == 0) {
+	if (has_nfs_args_opt == 0 && vfs_getopt(mp->mnt_optnew, "addr",
+	    (void **)&args.addr, &args.addrlen) == 0) {
 		if (args.addrlen > SOCK_MAXADDRLEN) {
 			error = ENAMETOOLONG;
 			goto out;

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 01:14:13 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4761C106566B;
	Fri, 29 Apr 2011 01:14:13 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3970F8FC0C;
	Fri, 29 Apr 2011 01:14:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3T1ED52077274;
	Fri, 29 Apr 2011 01:14:13 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3T1EDmt077272;
	Fri, 29 Apr 2011 01:14:13 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104290114.p3T1EDmt077272@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 29 Apr 2011 01:14:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221194 - head/sbin/mount
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 01:14:13 -0000

Author: rmacklem
Date: Fri Apr 29 01:14:12 2011
New Revision: 221194
URL: http://svn.freebsd.org/changeset/base/221194

Log:
  Another man page update related to the switchover of the
  NFS clients done by r221124.
  This is a content change.
  
  Submitted by:	jh

Modified:
  head/sbin/mount/mount.8

Modified: head/sbin/mount/mount.8
==============================================================================
--- head/sbin/mount/mount.8	Fri Apr 29 00:40:00 2011	(r221193)
+++ head/sbin/mount/mount.8	Fri Apr 29 01:14:12 2011	(r221194)
@@ -28,7 +28,7 @@
 .\"     @(#)mount.8	8.8 (Berkeley) 6/16/94
 .\" $FreeBSD$
 .\"
-.Dd February 10, 2010
+.Dd April 28, 2011
 .Dt MOUNT 8
 .Os
 .Sh NAME
@@ -430,11 +430,11 @@ However, for the following file system t
 .Cm cd9660 ,
 .Cm mfs ,
 .Cm msdosfs ,
-.Cm newnfs ,
 .Cm nfs ,
 .Cm ntfs ,
 .Cm nwfs ,
 .Cm nullfs ,
+.Cm oldnfs ,
 .Cm portalfs ,
 .Cm smbfs ,
 .Cm udf ,

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 06:25:11 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9769106564A;
	Fri, 29 Apr 2011 06:25:11 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D81B78FC0A;
	Fri, 29 Apr 2011 06:25:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3T6PB5n086399;
	Fri, 29 Apr 2011 06:25:11 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3T6PBPC086397;
	Fri, 29 Apr 2011 06:25:11 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104290625.p3T6PBPC086397@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 29 Apr 2011 06:25:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221198 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 06:25:12 -0000

Author: adrian
Date: Fri Apr 29 06:25:11 2011
New Revision: 221198
URL: http://svn.freebsd.org/changeset/base/221198

Log:
  Tidy up the naming of the ip2 DDR flush routine, and add an inline
  accessor method (which is currently unused) in there.

Modified:
  head/sys/mips/atheros/ar71xx_cpudef.h

Modified: head/sys/mips/atheros/ar71xx_cpudef.h
==============================================================================
--- head/sys/mips/atheros/ar71xx_cpudef.h	Fri Apr 29 05:00:48 2011	(r221197)
+++ head/sys/mips/atheros/ar71xx_cpudef.h	Fri Apr 29 06:25:11 2011	(r221198)
@@ -51,7 +51,7 @@ struct ar71xx_cpu_def {
 	 * This flush is done before the IRQ is handled to make
 	 * sure the driver correctly sees any memory updates.
 	 */
-	void (* ar71xx_chip_irq_flush_ip2) (void);
+	void (* ar71xx_chip_ddr_flush_ip2) (void);
 	/*
 	 * The USB peripheral init code is subtly different for
 	 * each chip.
@@ -106,6 +106,11 @@ static inline void ar71xx_init_usb_perip
 	ar71xx_cpu_ops->ar71xx_chip_init_usb_peripheral();
 }
 
+static inline void ar71xx_device_ddr_flush_ip2(void)
+{
+	ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ip2();
+}
+
 /* XXX shouldn't be here! */
 extern uint32_t u_ar71xx_cpu_freq;
 extern uint32_t u_ar71xx_ahb_freq;

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 06:28:30 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5120A106566B;
	Fri, 29 Apr 2011 06:28:30 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3FE6E8FC12;
	Fri, 29 Apr 2011 06:28:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3T6SU2l086526;
	Fri, 29 Apr 2011 06:28:30 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3T6SUV5086524;
	Fri, 29 Apr 2011 06:28:30 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201104290628.p3T6SUV5086524@svn.freebsd.org>
From: Kevin Lo 
Date: Fri, 29 Apr 2011 06:28:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221199 - head/sys/dev/usb/wlan
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 06:28:30 -0000

Author: kevlo
Date: Fri Apr 29 06:28:29 2011
New Revision: 221199
URL: http://svn.freebsd.org/changeset/base/221199

Log:
  Guard against default ni_chan
  
  PR: kern/144642
  Submitted by: Arthur Hartwig 

Modified:
  head/sys/dev/usb/wlan/if_rum.c

Modified: head/sys/dev/usb/wlan/if_rum.c
==============================================================================
--- head/sys/dev/usb/wlan/if_rum.c	Fri Apr 29 06:25:11 2011	(r221198)
+++ head/sys/dev/usb/wlan/if_rum.c	Fri Apr 29 06:28:29 2011	(r221199)
@@ -208,7 +208,7 @@ static void		rum_init(void *);
 static void		rum_stop(struct rum_softc *);
 static void		rum_load_microcode(struct rum_softc *, const uint8_t *,
 			    size_t);
-static int		rum_prepare_beacon(struct rum_softc *,
+static void		rum_prepare_beacon(struct rum_softc *,
 			    struct ieee80211vap *);
 static int		rum_raw_xmit(struct ieee80211_node *, struct mbuf *,
 			    const struct ieee80211_bpf_params *);
@@ -2119,7 +2119,7 @@ rum_load_microcode(struct rum_softc *sc,
 	rum_pause(sc, hz / 8);
 }
 
-static int
+static void
 rum_prepare_beacon(struct rum_softc *sc, struct ieee80211vap *vap)
 {
 	struct ieee80211com *ic = vap->iv_ic;
@@ -2127,9 +2127,12 @@ rum_prepare_beacon(struct rum_softc *sc,
 	struct rum_tx_desc desc;
 	struct mbuf *m0;
 
+	if (vap->iv_bss->ni_chan == IEEE80211_CHAN_ANYC)
+		return;
+
 	m0 = ieee80211_beacon_alloc(vap->iv_bss, &RUM_VAP(vap)->bo);
 	if (m0 == NULL) {
-		return ENOBUFS;
+		return;
 	}
 
 	tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_bsschan)];
@@ -2144,8 +2147,6 @@ rum_prepare_beacon(struct rum_softc *sc,
 	    m0->m_pkthdr.len);
 
 	m_freem(m0);
-
-	return 0;
 }
 
 static int

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 06:36:40 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0A864106566C;
	Fri, 29 Apr 2011 06:36:40 +0000 (UTC)
	(envelope-from kevlo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ED41D8FC1E;
	Fri, 29 Apr 2011 06:36:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3T6ad1H086797;
	Fri, 29 Apr 2011 06:36:39 GMT (envelope-from kevlo@svn.freebsd.org)
Received: (from kevlo@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3T6adMX086793;
	Fri, 29 Apr 2011 06:36:39 GMT (envelope-from kevlo@svn.freebsd.org)
Message-Id: <201104290636.p3T6adMX086793@svn.freebsd.org>
From: Kevin Lo 
Date: Fri, 29 Apr 2011 06:36:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221200 - in head/sys: amd64/conf conf i386/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 06:36:40 -0000

Author: kevlo
Date: Fri Apr 29 06:36:39 2011
New Revision: 221200
URL: http://svn.freebsd.org/changeset/base/221200

Log:
  Add urtw(4)

Modified:
  head/sys/amd64/conf/GENERIC
  head/sys/conf/NOTES
  head/sys/i386/conf/GENERIC

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Fri Apr 29 06:28:29 2011	(r221199)
+++ head/sys/amd64/conf/GENERIC	Fri Apr 29 06:36:39 2011	(r221200)
@@ -316,6 +316,7 @@ device		udav		# Davicom DM9601E USB
 device		rum		# Ralink Technology RT2501USB wireless NICs
 device		uath		# Atheros AR5523 wireless NICs
 device		ural		# Ralink Technology RT2500USB wireless NICs
+device		urtw		# Realtek RTL8187B/L wireless NICs
 device		zyd		# ZyDAS zb1211/zb1211b wireless NICs
 
 # FireWire support

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Fri Apr 29 06:28:29 2011	(r221199)
+++ head/sys/conf/NOTES	Fri Apr 29 06:36:39 2011	(r221200)
@@ -2730,6 +2730,9 @@ device		uath
 # Ralink Technology RT2500USB wireless driver
 device		ural
 #
+# Realtek RTL8187B/L wireless driver
+device		urtw
+#
 # ZyDas ZD1211/ZD1211B wireless driver
 device		zyd
 

Modified: head/sys/i386/conf/GENERIC
==============================================================================
--- head/sys/i386/conf/GENERIC	Fri Apr 29 06:28:29 2011	(r221199)
+++ head/sys/i386/conf/GENERIC	Fri Apr 29 06:36:39 2011	(r221200)
@@ -329,6 +329,7 @@ device		udav		# Davicom DM9601E USB
 device		rum		# Ralink Technology RT2501USB wireless NICs
 device		uath		# Atheros AR5523 wireless NICs
 device		ural		# Ralink Technology RT2500USB wireless NICs
+device		urtw		# Realtek RTL8187B/L wireless NICs
 device		zyd		# ZyDAS zb1211/zb1211b wireless NICs
 
 # FireWire support

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 07:11:09 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C6BE6106566B;
	Fri, 29 Apr 2011 07:11:09 +0000 (UTC)
	(envelope-from bschmidt@techwires.net)
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 03E748FC0C;
	Fri, 29 Apr 2011 07:11:08 +0000 (UTC)
Received: by bwz12 with SMTP id 12so4145625bwz.13
	for ; Fri, 29 Apr 2011 00:11:07 -0700 (PDT)
Received: by 10.204.81.196 with SMTP id y4mr325426bkk.111.1304061032855;
	Fri, 29 Apr 2011 00:10:32 -0700 (PDT)
Received: from jessie.localnet (p5B2ECD51.dip0.t-ipconnect.de [91.46.205.81])
	by mx.google.com with ESMTPS id
	c11sm1433337bkc.14.2011.04.29.00.10.31 (version=SSLv3 cipher=OTHER);
	Fri, 29 Apr 2011 00:10:32 -0700 (PDT)
Sender: Bernhard Schmidt 
From: Bernhard Schmidt 
To: Kevin Lo 
Date: Fri, 29 Apr 2011 09:09:34 +0200
User-Agent: KMail/1.13.5 (Linux/2.6.32-31-generic; KDE/4.4.5; i686; ; )
References: <201104290628.p3T6SUV5086524@svn.freebsd.org>
In-Reply-To: <201104290628.p3T6SUV5086524@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201104290909.34920.bschmidt@freebsd.org>
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Arthur Hartwig 
Subject: Re: svn commit: r221199 - head/sys/dev/usb/wlan
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: bschmidt@freebsd.org
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 07:11:09 -0000

On Friday, April 29, 2011 08:28:30 Kevin Lo wrote:
> Author: kevlo
> Date: Fri Apr 29 06:28:29 2011
> New Revision: 221199
> URL: http://svn.freebsd.org/changeset/base/221199
> 
> Log:
>   Guard against default ni_chan
>   
>   PR: kern/144642
>   Submitted by: Arthur Hartwig 
> 
> Modified:
>   head/sys/dev/usb/wlan/if_rum.c

This seems about right, but.. did anyone ever verify that any beacons
get sent? and if so are the information included correct?

If the call fails due to the channel not yet being set, no further
attempt to setup the beacons are made. This might be quite harmless
for IBSS as long as other nodes are sending beacons. But for AP mode
it is rather critical. There also seem to be at least one missing
backcall, iv_update_beacon, this should ensure that beacons contain
updated information, eg. node's powersafe states. It can also be used
to ensure the beacon is setup.

Any takers? :)

-- 
Bernhard

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 07:14:38 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 594D6106564A;
	Fri, 29 Apr 2011 07:14:38 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 47AE08FC08;
	Fri, 29 Apr 2011 07:14:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3T7EcXO087988;
	Fri, 29 Apr 2011 07:14:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3T7Ec93087986;
	Fri, 29 Apr 2011 07:14:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201104290714.p3T7Ec93087986@svn.freebsd.org>
From: Alexander Motin 
Date: Fri, 29 Apr 2011 07:14:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221201 - head/sys/cam
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 07:14:38 -0000

Author: mav
Date: Fri Apr 29 07:14:37 2011
New Revision: 221201
URL: http://svn.freebsd.org/changeset/base/221201

Log:
  Make CAM_DEBUG_CDB also dump ATA commands in addition to SCSI.

Modified:
  head/sys/cam/cam_xpt.c

Modified: head/sys/cam/cam_xpt.c
==============================================================================
--- head/sys/cam/cam_xpt.c	Fri Apr 29 06:36:39 2011	(r221200)
+++ head/sys/cam/cam_xpt.c	Fri Apr 29 07:14:37 2011	(r221201)
@@ -2328,19 +2328,18 @@ xpt_action(union ccb *start_ccb)
 void
 xpt_action_default(union ccb *start_ccb)
 {
+#ifdef CAMDEBUG
+	char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
+#endif
+	struct cam_path *path;
 
-	CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action_default\n"));
+	path = start_ccb->ccb_h.path;
+	CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_action_default\n"));
 
 	switch (start_ccb->ccb_h.func_code) {
 	case XPT_SCSI_IO:
 	{
 		struct cam_ed *device;
-#ifdef CAMDEBUG
-		char cdb_str[(SCSI_MAX_CDBLEN * 3) + 1];
-		struct cam_path *path;
-
-		path = start_ccb->ccb_h.path;
-#endif
 
 		/*
 		 * For the sake of compatibility with SCSI-1
@@ -2358,7 +2357,7 @@ xpt_action_default(union ccb *start_ccb)
 		 * This means that this code will be exercised while probing
 		 * devices with an ANSI revision greater than 2.
 		 */
-		device = start_ccb->ccb_h.path->device;
+		device = path->device;
 		if (device->protocol_version <= SCSI_REV_2
 		 && start_ccb->ccb_h.target_lun < 8
 		 && (start_ccb->ccb_h.flags & CAM_CDB_POINTER) == 0) {
@@ -2382,13 +2381,16 @@ xpt_action_default(union ccb *start_ccb)
 	case XPT_ATA_IO:
 		if (start_ccb->ccb_h.func_code == XPT_ATA_IO) {
 			start_ccb->ataio.resid = 0;
+			CAM_DEBUG(path, CAM_DEBUG_CDB,("%s. ACB: %s\n",
+			    ata_op_string(&start_ccb->ataio.cmd),
+			    ata_cmd_string(&start_ccb->ataio.cmd,
+					  cdb_str, sizeof(cdb_str))));
 		}
 		/* FALLTHROUGH */
 	case XPT_RESET_DEV:
 	case XPT_ENG_EXEC:
 	case XPT_SMP_IO:
 	{
-		struct cam_path *path = start_ccb->ccb_h.path;
 		int frozen;
 
 		frozen = cam_ccbq_insert_ccb(&path->device->ccbq, start_ccb);
@@ -2427,7 +2429,7 @@ xpt_action_default(union ccb *start_ccb)
 			break;
 		}
 #endif
-		sim = start_ccb->ccb_h.path->bus->sim;
+		sim = path->bus->sim;
 		(*(sim->sim_action))(sim, start_ccb);
 		break;
 	}
@@ -2495,7 +2497,7 @@ xpt_action_default(union ccb *start_ccb)
 	{
 		struct cam_sim *sim;
 
-		sim = start_ccb->ccb_h.path->bus->sim;
+		sim = path->bus->sim;
 		(*(sim->sim_action))(sim, start_ccb);
 		break;
 	}
@@ -2503,20 +2505,19 @@ xpt_action_default(union ccb *start_ccb)
 	{
 		struct cam_sim *sim;
 
-		sim = start_ccb->ccb_h.path->bus->sim;
+		sim = path->bus->sim;
 		(*(sim->sim_action))(sim, start_ccb);
 		break;
 	}
 	case XPT_PATH_STATS:
-		start_ccb->cpis.last_reset =
-			start_ccb->ccb_h.path->bus->last_reset;
+		start_ccb->cpis.last_reset = path->bus->last_reset;
 		start_ccb->ccb_h.status = CAM_REQ_CMP;
 		break;
 	case XPT_GDEV_TYPE:
 	{
 		struct cam_ed *dev;
 
-		dev = start_ccb->ccb_h.path->device;
+		dev = path->device;
 		if ((dev->flags & CAM_DEV_UNCONFIGURED) != 0) {
 			start_ccb->ccb_h.status = CAM_DEV_NOT_THERE;
 		} else {
@@ -2540,7 +2541,7 @@ xpt_action_default(union ccb *start_ccb)
 	{
 		struct cam_ed *dev;
 
-		dev = start_ccb->ccb_h.path->device;
+		dev = path->device;
 		if ((dev->flags & CAM_DEV_UNCONFIGURED) != 0) {
 			start_ccb->ccb_h.status = CAM_DEV_NOT_THERE;
 		} else {
@@ -2549,8 +2550,8 @@ xpt_action_default(union ccb *start_ccb)
 			struct cam_et *tar;
 
 			cgds = &start_ccb->cgds;
-			bus = cgds->ccb_h.path->bus;
-			tar = cgds->ccb_h.path->target;
+			bus = path->bus;
+			tar = path->target;
 			cgds->dev_openings = dev->ccbq.dev_openings;
 			cgds->dev_active = dev->ccbq.dev_active;
 			cgds->devq_openings = dev->ccbq.devq_openings;
@@ -2580,7 +2581,7 @@ xpt_action_default(union ccb *start_ccb)
 		/*
 		 * Don't want anyone mucking with our data.
 		 */
-		device = start_ccb->ccb_h.path->device;
+		device = path->device;
 		periph_head = &device->periphs;
 		cgdl = &start_ccb->cgdl;
 
@@ -2697,7 +2698,7 @@ xpt_action_default(union ccb *start_ccb)
 
 		csa = &start_ccb->csa;
 		added = csa->event_enable;
-		async_head = &csa->ccb_h.path->device->asyncs;
+		async_head = &path->device->asyncs;
 
 		/*
 		 * If there is already an entry for us, simply
@@ -2720,7 +2721,7 @@ xpt_action_default(union ccb *start_ccb)
 			if (csa->event_enable == 0) {
 				SLIST_REMOVE(async_head, cur_entry,
 					     async_node, links);
-				xpt_release_device(csa->ccb_h.path->device);
+				xpt_release_device(path->device);
 				free(cur_entry, M_CAMXPT);
 			} else {
 				cur_entry->event_enable = csa->event_enable;
@@ -2737,7 +2738,7 @@ xpt_action_default(union ccb *start_ccb)
 			cur_entry->callback_arg = csa->callback_arg;
 			cur_entry->callback = csa->callback;
 			SLIST_INSERT_HEAD(async_head, cur_entry, links);
-			xpt_acquire_device(csa->ccb_h.path->device);
+			xpt_acquire_device(path->device);
 		}
 		start_ccb->ccb_h.status = CAM_REQ_CMP;
 		break;
@@ -2748,7 +2749,7 @@ xpt_action_default(union ccb *start_ccb)
 		struct cam_ed *dev;
 
 		crs = &start_ccb->crs;
-		dev = crs->ccb_h.path->device;
+		dev = path->device;
 		if (dev == NULL) {
 
 			crs->ccb_h.status = CAM_DEV_NOT_THERE;
@@ -2760,11 +2761,11 @@ xpt_action_default(union ccb *start_ccb)
  			if (INQ_DATA_TQ_ENABLED(&dev->inq_data)) {
 				/* Don't ever go below one opening */
 				if (crs->openings > 0) {
-					xpt_dev_ccbq_resize(crs->ccb_h.path,
+					xpt_dev_ccbq_resize(path,
 							    crs->openings);
 
 					if (bootverbose) {
-						xpt_print(crs->ccb_h.path,
+						xpt_print(path,
 						    "tagged openings now %d\n",
 						    crs->openings);
 					}
@@ -2826,7 +2827,7 @@ xpt_action_default(union ccb *start_ccb)
 		}
 
 		if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) == 0) {
-			xpt_release_devq_rl(crs->ccb_h.path, /*runlevel*/
+			xpt_release_devq_rl(path, /*runlevel*/
 			    (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ?
 				crs->release_timeout : 0,
 			    /*count*/1, /*run_queue*/TRUE);
@@ -2872,7 +2873,7 @@ xpt_action_default(union ccb *start_ccb)
 	{
 		struct ccb_relsim *crs = &start_ccb->crs;
 
-		xpt_freeze_devq_rl(crs->ccb_h.path, /*runlevel*/
+		xpt_freeze_devq_rl(path, /*runlevel*/
 		    (crs->release_flags & RELSIM_RELEASE_RUNLEVEL) ?
 		    crs->release_timeout : 0, /*count*/1);
 		start_ccb->ccb_h.status = CAM_REQ_CMP;
@@ -2880,7 +2881,7 @@ xpt_action_default(union ccb *start_ccb)
 	}
 	case XPT_NOOP:
 		if ((start_ccb->ccb_h.flags & CAM_DEV_QFREEZE) != 0)
-			xpt_freeze_devq(start_ccb->ccb_h.path, 1);
+			xpt_freeze_devq(path, 1);
 		start_ccb->ccb_h.status = CAM_REQ_CMP;
 		break;
 	default:

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 12:30:15 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 946F1106566B;
	Fri, 29 Apr 2011 12:30:15 +0000 (UTC)
	(envelope-from rmacklem@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 82D238FC12;
	Fri, 29 Apr 2011 12:30:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TCUFa7099083;
	Fri, 29 Apr 2011 12:30:15 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Received: (from rmacklem@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TCUFOR099081;
	Fri, 29 Apr 2011 12:30:15 GMT
	(envelope-from rmacklem@svn.freebsd.org)
Message-Id: <201104291230.p3TCUFOR099081@svn.freebsd.org>
From: Rick Macklem 
Date: Fri, 29 Apr 2011 12:30:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221205 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 12:30:15 -0000

Author: rmacklem
Date: Fri Apr 29 12:30:15 2011
New Revision: 221205
URL: http://svn.freebsd.org/changeset/base/221205

Log:
  The build was broken by r221190 for 64bit arches like amd64.
  This patch fixes it.
  
  MFC after:	2 weeks

Modified:
  head/sys/fs/nfsclient/nfs_clvfsops.c

Modified: head/sys/fs/nfsclient/nfs_clvfsops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clvfsops.c	Fri Apr 29 10:33:54 2011	(r221204)
+++ head/sys/fs/nfsclient/nfs_clvfsops.c	Fri Apr 29 12:30:15 2011	(r221205)
@@ -763,6 +763,7 @@ nfs_mount(struct mount *mp)
 	char *opt, *name, *secname;
 	int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO;
 	int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen;
+	size_t hstlen;
 
 	has_nfs_args_opt = 0;
 	if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) {
@@ -1027,10 +1028,10 @@ nfs_mount(struct mount *mp)
 		    args.fhsize);
 		if (error != 0)
 			goto out;
-		error = copyinstr(args.hostname, hst, MNAMELEN - 1, &len);
+		error = copyinstr(args.hostname, hst, MNAMELEN - 1, &hstlen);
 		if (error != 0)
 			goto out;
-		bzero(&hst[len], MNAMELEN - len);
+		bzero(&hst[hstlen], MNAMELEN - hstlen);
 		args.hostname = hst;
 		/* sockargs() call must be after above copyin() calls */
 		error = getsockaddr(&nam, (caddr_t)args.addr,

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 12:52:19 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 106B4106566B;
	Fri, 29 Apr 2011 12:52:19 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F2A498FC1D;
	Fri, 29 Apr 2011 12:52:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TCqITN099732;
	Fri, 29 Apr 2011 12:52:18 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TCqIMs099730;
	Fri, 29 Apr 2011 12:52:18 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104291252.p3TCqIMs099730@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 29 Apr 2011 12:52:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221206 - head/sys/dev/ath/ath_hal/ar5416
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 12:52:19 -0000

Author: adrian
Date: Fri Apr 29 12:52:18 2011
New Revision: 221206
URL: http://svn.freebsd.org/changeset/base/221206

Log:
  Remove some holdovers from the AR5212 origin of this code.
  These aren't relevant here.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Apr 29 12:30:15 2011	(r221205)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c	Fri Apr 29 12:52:18 2011	(r221206)
@@ -201,23 +201,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	HALDEBUG(ah, HAL_DEBUG_RESET, ">>>2 %s: AR_PHY_ADC_CTL=0x%x\n",
 		__func__, OS_REG_READ(ah,AR_PHY_ADC_CTL));	
 
-	/* Set the mute mask to the correct default */
-	if (AH_PRIVATE(ah)->ah_phyRev >= AR_PHY_CHIP_ID_REV_2)
-		OS_REG_WRITE(ah, AR_SEQ_MASK, 0x0000000F);
-
-	if (AH_PRIVATE(ah)->ah_phyRev >= AR_PHY_CHIP_ID_REV_3) {
-		/* Clear reg to alllow RX_CLEAR line debug */
-		OS_REG_WRITE(ah, AR_PHY_BLUETOOTH,  0);
-	}
-	if (AH_PRIVATE(ah)->ah_phyRev >= AR_PHY_CHIP_ID_REV_4) {
-#ifdef notyet
-		/* Enable burst prefetch for the data queues */
-		OS_REG_RMW_FIELD(ah, AR_D_FPCTL, ... );
-		/* Enable double-buffering */
-		OS_REG_CLR_BIT(ah, AR_TXCFG, AR_TXCFG_DBL_BUF_DIS);
-#endif
-	}
-
 	/*
 	 * Setup ah_tx_chainmask / ah_rx_chainmask before we fiddle
 	 * with enabling the TX/RX radio chains.
@@ -228,6 +211,8 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO
 	 * before any radio register twiddling is done.
 	 */
 	ar5416InitChainMasks(ah);
+
+	/* Setup the open-loop temperature compensation if required */
 	AH5416(ah)->ah_olcInit(ah);
 
 	/* Setup the transmit power values. */

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 14:01:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5874E106567E;
	Fri, 29 Apr 2011 14:01:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0DB378FC15;
	Fri, 29 Apr 2011 14:01:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TE1n8Q001993;
	Fri, 29 Apr 2011 14:01:49 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TE1nvn001991;
	Fri, 29 Apr 2011 14:01:49 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104291401.p3TE1nvn001991@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 14:01:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221207 - head/sys/arm/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 14:01:50 -0000

Author: jhb
Date: Fri Apr 29 14:01:49 2011
New Revision: 221207
URL: http://svn.freebsd.org/changeset/base/221207

Log:
  Fix build of this kernel config.  The ath(4) bits need the 11n frame format
  even though ar5416 isn't enabled.
  
  Reviewed by:	adrian

Modified:
  head/sys/arm/conf/CAMBRIA

Modified: head/sys/arm/conf/CAMBRIA
==============================================================================
--- head/sys/arm/conf/CAMBRIA	Fri Apr 29 12:52:18 2011	(r221206)
+++ head/sys/arm/conf/CAMBRIA	Fri Apr 29 14:01:49 2011	(r221207)
@@ -144,7 +144,7 @@ device		ath_rf5112
 device		ath_rf5413
 #
 #device		ath_ar5416
-#options 	AH_SUPPORT_AR5416	# NB: for 11n descriptor format
+options 	AH_SUPPORT_AR5416	# NB: for 11n descriptor format
 #device		ath_ar9160
 #device		ath_ar9280
 

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 14:06:37 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CBA25106567C;
	Fri, 29 Apr 2011 14:06:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ADF898FC18;
	Fri, 29 Apr 2011 14:06:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TE6bUF002165;
	Fri, 29 Apr 2011 14:06:37 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TE6bHD002161;
	Fri, 29 Apr 2011 14:06:37 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104291406.p3TE6bHD002161@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 14:06:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221208 - head/usr.sbin/mfiutil
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 14:06:37 -0000

Author: jhb
Date: Fri Apr 29 14:06:37 2011
New Revision: 221208
URL: http://svn.freebsd.org/changeset/base/221208

Log:
  Add a 'show progress' command that shows a summary of all in-progress
  commands for a given adapter.  Specifically, it shows the status of any
  drive or volume activities currently in progress similar to the
  'drive process' and 'volume progress' commands.
  
  Reviewed by:	emaste
  MFC after:	1 week

Modified:
  head/usr.sbin/mfiutil/mfi_show.c
  head/usr.sbin/mfiutil/mfiutil.8
  head/usr.sbin/mfiutil/mfiutil.c

Modified: head/usr.sbin/mfiutil/mfi_show.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_show.c	Fri Apr 29 14:01:49 2011	(r221207)
+++ head/usr.sbin/mfiutil/mfi_show.c	Fri Apr 29 14:06:37 2011	(r221208)
@@ -572,7 +572,7 @@ show_firmware(int ac, char **av)
 	u_int i;
 
 	if (ac != 1) {
-		warnx("show drives: extra arguments");
+		warnx("show firmware: extra arguments");
 		return (EINVAL);
 	}
 
@@ -617,3 +617,112 @@ show_firmware(int ac, char **av)
 	return (0);
 }
 MFI_COMMAND(show, firmware, show_firmware);
+
+static int
+show_progress(int ac, char **av)
+{
+	struct mfi_ld_list llist;
+	struct mfi_pd_list *plist;
+	struct mfi_ld_info linfo;
+	struct mfi_pd_info pinfo;
+	int busy, error, fd;
+	u_int i;
+	
+	uint16_t device_id;
+	uint8_t target_id;
+
+	if (ac != 1) {
+		warnx("show progress: extra arguments");
+		return (EINVAL);
+	}
+
+	fd = mfi_open(mfi_unit);
+	if (fd < 0) {
+		error = errno;
+		warn("mfi_open");
+		return (error);
+	}
+	busy = 0;
+
+	if (mfi_ld_get_list(fd, &llist, NULL) < 0) {
+		error = errno;
+		warn("Failed to get volume list");
+		return (error);
+	}
+	if (mfi_pd_get_list(fd, &plist, NULL) < 0) {
+		error = errno;
+		warn("Failed to get drive list");
+		return (error);
+	}
+
+	for (i = 0; i < llist.ld_count; i++) {
+		target_id = llist.ld_list[i].ld.v.target_id;
+		if (mfi_ld_get_info(fd, target_id, &linfo, NULL) < 0) {
+			error = errno;
+			warn("Failed to get info for volume %s",
+			    mfi_volume_name(fd, target_id));
+			return (error);
+		}
+		if (linfo.progress.active & MFI_LD_PROGRESS_CC) {
+			printf("volume %s ", mfi_volume_name(fd, target_id));
+			mfi_display_progress("Consistency Check",
+			    &linfo.progress.cc);
+			busy = 1;
+		}
+		if (linfo.progress.active & MFI_LD_PROGRESS_BGI) {
+			printf("volume %s ", mfi_volume_name(fd, target_id));
+			mfi_display_progress("Background Init",
+			    &linfo.progress.bgi);
+			busy = 1;
+		}
+		if (linfo.progress.active & MFI_LD_PROGRESS_FGI) {
+			printf("volume %s ", mfi_volume_name(fd, target_id));
+			mfi_display_progress("Foreground Init",
+			    &linfo.progress.fgi);
+			busy = 1;
+		}
+		if (linfo.progress.active & MFI_LD_PROGRESS_RECON) {
+			printf("volume %s ", mfi_volume_name(fd, target_id));
+			mfi_display_progress("Reconstruction",
+			    &linfo.progress.recon);
+			busy = 1;
+		}
+	}
+
+	for (i = 0; i < plist->count; i++) {
+		if (plist->addr[i].scsi_dev_type != 0)
+			continue;
+
+		device_id = plist->addr[i].device_id;
+		if (mfi_pd_get_info(fd, device_id, &pinfo, NULL) < 0) {
+			error = errno;
+			warn("Failed to fetch info for drive %u", device_id);
+			return (error);
+		}
+
+		if (pinfo.prog_info.active & MFI_PD_PROGRESS_REBUILD) {
+			printf("drive %u ", device_id);
+			mfi_display_progress("Rebuild", &pinfo.prog_info.rbld);
+			busy = 1;
+		}
+		if (pinfo.prog_info.active & MFI_PD_PROGRESS_PATROL) {
+			printf("drive %u ", device_id);
+			mfi_display_progress("Patrol Read",
+			    &pinfo.prog_info.patrol);
+			busy = 1;
+		}
+		if (pinfo.prog_info.active & MFI_PD_PROGRESS_CLEAR) {
+			printf("drive %u ", device_id);
+			mfi_display_progress("Clear", &pinfo.prog_info.clear);
+			busy = 1;
+		}
+	}
+
+	close(fd);
+
+	if (!busy)
+		printf("No activity in progress for adapter mfi%d\n", mfi_unit);
+
+	return (0);
+}
+MFI_COMMAND(show, progress, show_progress);

Modified: head/usr.sbin/mfiutil/mfiutil.8
==============================================================================
--- head/usr.sbin/mfiutil/mfiutil.8	Fri Apr 29 14:01:49 2011	(r221207)
+++ head/usr.sbin/mfiutil/mfiutil.8	Fri Apr 29 14:06:37 2011	(r221208)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 5, 2011
+.Dd April 29, 2011
 .Dt MFIUTIL 8
 .Os
 .Sh NAME
@@ -67,6 +67,9 @@
 .Cm show patrol
 .Nm
 .Op Fl u Ar unit
+.Cm show progress
+.Nm
+.Op Fl u Ar unit
 .Cm show volumes
 .Nm
 .Op Fl u Ar unit
@@ -296,6 +299,9 @@ Lists all of the firmware images present
 Display the various sequence numbers associated with the event log.
 .It Cm show patrol
 Display the status of the controller's patrol read operation.
+.It Cm show progress
+Report the current progress and estimated completion time for active
+operations on all volumes and drives.
 .It Cm show volumes
 Lists all of the logical volumes managed by the controller.
 .El

Modified: head/usr.sbin/mfiutil/mfiutil.c
==============================================================================
--- head/usr.sbin/mfiutil/mfiutil.c	Fri Apr 29 14:01:49 2011	(r221207)
+++ head/usr.sbin/mfiutil/mfiutil.c	Fri Apr 29 14:06:37 2011	(r221208)
@@ -60,6 +60,7 @@ usage(void)
 	fprintf(stderr, "    show firmware             - list firmware images\n");
 	fprintf(stderr, "    show volumes              - list logical volumes\n");
 	fprintf(stderr, "    show patrol               - display patrol read status\n");
+	fprintf(stderr, "    show progress             - display status of active operations\n");
 	fprintf(stderr, "    fail               - fail a physical drive\n");
 	fprintf(stderr, "    good               - mark a bad physical drive as good\n");
 	fprintf(stderr, "    rebuild            - mark failed drive ready for rebuild\n");

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 14:24:37 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8346E106567B;
	Fri, 29 Apr 2011 14:24:37 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42])
	by mx1.freebsd.org (Postfix) with ESMTP id 54D5F8FC1C;
	Fri, 29 Apr 2011 14:24:37 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 0185846B59;
	Fri, 29 Apr 2011 10:24:37 -0400 (EDT)
Received: from jhbbsd.localnet (unknown [209.249.190.124])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6AAE38A02A;
	Fri, 29 Apr 2011 10:24:36 -0400 (EDT)
From: John Baldwin 
To: Rick Macklem 
Date: Fri, 29 Apr 2011 10:24:34 -0400
User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; )
References: <201104291230.p3TCUFOR099081@svn.freebsd.org>
In-Reply-To: <201104291230.p3TCUFOR099081@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201104291024.34096.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(bigwig.baldwin.cx); Fri, 29 Apr 2011 10:24:36 -0400 (EDT)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221205 - head/sys/fs/nfsclient
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 14:24:37 -0000

On Friday, April 29, 2011 8:30:15 am Rick Macklem wrote:
> Author: rmacklem
> Date: Fri Apr 29 12:30:15 2011
> New Revision: 221205
> URL: http://svn.freebsd.org/changeset/base/221205
> 
> Log:
>   The build was broken by r221190 for 64bit arches like amd64.
>   This patch fixes it.
>   
>   MFC after:	2 weeks
> 
> Modified:
>   head/sys/fs/nfsclient/nfs_clvfsops.c
> 
> Modified: head/sys/fs/nfsclient/nfs_clvfsops.c

Somewhat related.  It seems the vfs_* API used to process nmount-style
mount options, uses 'int' instead of 'size_t' for all of its 'len'
parameters.  I think this is a bug and that it should be fixed to use
size_t instead.  That would let this change be reverted as 'len' could
always be a size_t in this case.

-- 
John Baldwin

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 15:40:12 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AA10D106567A;
	Fri, 29 Apr 2011 15:40:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 96E678FC0C;
	Fri, 29 Apr 2011 15:40:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TFeCNJ004942;
	Fri, 29 Apr 2011 15:40:12 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TFeChw004937;
	Fri, 29 Apr 2011 15:40:12 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104291540.p3TFeChw004937@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 15:40:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221209 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 15:40:12 -0000

Author: jhb
Date: Fri Apr 29 15:40:12 2011
New Revision: 221209
URL: http://svn.freebsd.org/changeset/base/221209

Log:
  TCP reuses t_rxtshift to determine the backoff timer used for both the
  persist state and the retransmit timer.  However, the code that implements
  "bad retransmit recovery" only checks t_rxtshift to see if an ACK has been
  received in during the first retransmit timeout window.  As a result, if
  ticks has wrapped over to a negative value and a socket is in the persist
  state, it can incorrectly treat an ACK from the remote peer as a
  "bad retransmit recovery" and restore saved values such as snd_ssthresh and
  snd_cwnd.  However, if the socket has never had a retransmit timeout, then
  these saved values will be zero, so snd_ssthresh and snd_cwnd will be set
  to 0.
  
  If the socket is in fast recovery (this can be caused by excessive
  duplicate ACKs such as those fixed by 220794), then each ACK that arrives
  triggers either NewReno or SACK partial ACK handling which clamps snd_cwnd
  to be no larger than snd_ssthresh.  In effect, the socket's send window
  is permamently stuck at 0 even though the remote peer is advertising a
  much larger window and pending data is only sent via TCP window probes
  (so one byte every few seconds).
  
  Fix this by adding a new TCP pcb flag (TF_PREVVALID) that indicates that
  the various snd_*_prev fields in the pcb are valid and only perform
  "bad retransmit recovery" if this flag is set in the pcb.  The flag is set
  on the first retransmit timeout that occurs and is cleared on subsequent
  retransmit timeouts or when entering the persist state.
  
  Reviewed by:	bz
  MFC after:	2 weeks

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Fri Apr 29 14:06:37 2011	(r221208)
+++ head/sys/netinet/tcp_input.c	Fri Apr 29 15:40:12 2011	(r221209)
@@ -420,6 +420,7 @@ cc_cong_signal(struct tcpcb *tp, struct 
 		if (tp->t_flags & TF_WASCRECOVERY)
 			ENTER_CONGRECOVERY(tp->t_flags);
 		tp->snd_nxt = tp->snd_max;
+		tp->t_flags &= ~TF_PREVVALID;
 		tp->t_badrxtwin = 0;
 		break;
 	}
@@ -1575,6 +1576,7 @@ tcp_do_segment(struct mbuf *m, struct tc
 				 * "bad retransmit" recovery.
 				 */
 				if (tp->t_rxtshift == 1 &&
+				    tp->t_flags & TF_PREVVALID &&
 				    (int)(ticks - tp->t_badrxtwin) < 0) {
 					cc_cong_signal(tp, th, CC_RTO_ERR);
 				}
@@ -2521,7 +2523,8 @@ process_ACK:
 		 * original cwnd and ssthresh, and proceed to transmit where
 		 * we left off.
 		 */
-		if (tp->t_rxtshift == 1 && (int)(ticks - tp->t_badrxtwin) < 0)
+		if (tp->t_rxtshift == 1 && tp->t_flags & TF_PREVVALID &&
+		    (int)(ticks - tp->t_badrxtwin) < 0)
 			cc_cong_signal(tp, th, CC_RTO_ERR);
 
 		/*

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Fri Apr 29 14:06:37 2011	(r221208)
+++ head/sys/netinet/tcp_output.c	Fri Apr 29 15:40:12 2011	(r221209)
@@ -1346,6 +1346,7 @@ tcp_setpersist(struct tcpcb *tp)
 	int t = ((tp->t_srtt >> 2) + tp->t_rttvar) >> 1;
 	int tt;
 
+	tp->t_flags &= ~TF_PREVVALID;
 	if (tcp_timer_active(tp, TT_REXMT))
 		panic("tcp_setpersist: retransmit pending");
 	/*

Modified: head/sys/netinet/tcp_timer.c
==============================================================================
--- head/sys/netinet/tcp_timer.c	Fri Apr 29 14:06:37 2011	(r221208)
+++ head/sys/netinet/tcp_timer.c	Fri Apr 29 15:40:12 2011	(r221209)
@@ -524,7 +524,9 @@ tcp_timer_rexmt(void * xtp)
 		else
 			tp->t_flags &= ~TF_WASCRECOVERY;
 		tp->t_badrxtwin = ticks + (tp->t_srtt >> (TCP_RTT_SHIFT + 1));
-	}
+		tp->t_flags |= TF_PREVVALID;
+	} else
+		tp->t_flags &= ~TF_PREVVALID;
 	TCPSTAT_INC(tcps_rexmttimeo);
 	if (tp->t_state == TCPS_SYN_SENT)
 		rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift];

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Fri Apr 29 14:06:37 2011	(r221208)
+++ head/sys/netinet/tcp_var.h	Fri Apr 29 15:40:12 2011	(r221209)
@@ -224,6 +224,7 @@ struct tcpcb {
 #define	TF_NEEDSYN	0x000400	/* send SYN (implicit state) */
 #define	TF_NEEDFIN	0x000800	/* send FIN (implicit state) */
 #define	TF_NOPUSH	0x001000	/* don't push */
+#define	TF_PREVVALID	0x002000	/* saved values for bad rxmit valid */
 #define	TF_MORETOCOME	0x010000	/* More data to be appended to sock */
 #define	TF_LQ_OVERFLOW	0x020000	/* listen queue overflow */
 #define	TF_LASTIDLE	0x040000	/* connection was previously idle */

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 16:43:30 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB373106564A;
	Fri, 29 Apr 2011 16:43:30 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id AB4608FC13;
	Fri, 29 Apr 2011 16:43:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TGhUZ3006833;
	Fri, 29 Apr 2011 16:43:30 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TGhUQr006831;
	Fri, 29 Apr 2011 16:43:30 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104291643.p3TGhUQr006831@svn.freebsd.org>
From: Adrian Chadd 
Date: Fri, 29 Apr 2011 16:43:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221210 - head/sys/dev/ath
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 16:43:30 -0000

Author: adrian
Date: Fri Apr 29 16:43:30 2011
New Revision: 221210
URL: http://svn.freebsd.org/changeset/base/221210

Log:
  Cosmetic changes to fit 80 character screen width.

Modified:
  head/sys/dev/ath/if_ath.c

Modified: head/sys/dev/ath/if_ath.c
==============================================================================
--- head/sys/dev/ath/if_ath.c	Fri Apr 29 15:40:12 2011	(r221209)
+++ head/sys/dev/ath/if_ath.c	Fri Apr 29 16:43:30 2011	(r221210)
@@ -3586,14 +3586,14 @@ rx_accept:
 				IEEE80211_KEYIX_NONE : rs->rs_keyix);
 		sc->sc_lastrs = rs;
 
-		/* Keep statistics on the number of aggregate packets received */
 		if (rs->rs_isaggr)
 			sc->sc_stats.ast_rx_agg++;
 
 		if (ni != NULL) {
 			/*
- 			 * Only punt packets for ampdu reorder processing for 11n nodes;
- 			 * net80211 enforces that M_AMPDU is only set for 11n nodes.
+ 			 * Only punt packets for ampdu reorder processing for
+			 * 11n nodes; net80211 enforces that M_AMPDU is only
+			 * set for 11n nodes.
  			 */
 			if (ni->ni_flags & IEEE80211_NODE_HT)
 				m->m_flags |= M_AMPDU;

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 18:20:12 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F07861065673;
	Fri, 29 Apr 2011 18:20:12 +0000 (UTC)
	(envelope-from jkim@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D69108FC1E;
	Fri, 29 Apr 2011 18:20:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TIKCS9009885;
	Fri, 29 Apr 2011 18:20:12 GMT (envelope-from jkim@svn.freebsd.org)
Received: (from jkim@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TIKCv7009883;
	Fri, 29 Apr 2011 18:20:12 GMT (envelope-from jkim@svn.freebsd.org)
Message-Id: <201104291820.p3TIKCv7009883@svn.freebsd.org>
From: Jung-uk Kim 
Date: Fri, 29 Apr 2011 18:20:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221214 - head/sys/x86/x86
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 18:20:13 -0000

Author: jkim
Date: Fri Apr 29 18:20:12 2011
New Revision: 221214
URL: http://svn.freebsd.org/changeset/base/221214

Log:
  Detect VMware guest and set the TSC frequency as reported by the hypervisor.
  VMware products virtualize TSC and it run at fixed frequency in so-called
  "apparent time".  Although virtualized i8254 also runs in apparent time, TSC
  calibration always gives slightly off frequency because of the complicated
  timer emulation and lost-tick correction mechanism.

Modified:
  head/sys/x86/x86/tsc.c

Modified: head/sys/x86/x86/tsc.c
==============================================================================
--- head/sys/x86/x86/tsc.c	Fri Apr 29 18:17:01 2011	(r221213)
+++ head/sys/x86/x86/tsc.c	Fri Apr 29 18:20:12 2011	(r221214)
@@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -90,6 +91,87 @@ static struct timecounter tsc_timecounte
 	800,			/* quality (adjusted in code) */
 };
 
+#define	VMW_HVMAGIC		0x564d5868
+#define	VMW_HVPORT		0x5658
+#define	VMW_HVCMD_GETVERSION	10
+#define	VMW_HVCMD_GETHZ		45
+
+static __inline void
+vmware_hvcall(u_int cmd, u_int *p)
+{
+
+	__asm __volatile("inl (%%dx)"
+	: "=a" (p[0]), "=b" (p[1]), "=c" (p[2]), "=d" (p[3])
+	: "0" (VMW_HVMAGIC), "1" (UINT_MAX), "2" (cmd), "3" (VMW_HVPORT)
+	: "memory");
+}
+
+static int
+tsc_freq_vmware(void)
+{
+	char hv_sig[13];
+	u_int regs[4];
+	char *p;
+	u_int hv_high;
+	int i;
+
+	/*
+	 * [RFC] CPUID usage for interaction between Hypervisors and Linux.
+	 * http://lkml.org/lkml/2008/10/1/246
+	 *
+	 * KB1009458: Mechanisms to determine if software is running in
+	 * a VMware virtual machine
+	 * http://kb.vmware.com/kb/1009458
+	 */
+	hv_high = 0;
+	if ((cpu_feature2 & CPUID2_HV) != 0) {
+		do_cpuid(0x40000000, regs);
+		hv_high = regs[0];
+		for (i = 1, p = hv_sig; i < 4; i++, p += sizeof(regs) / 4)
+			memcpy(p, ®s[i], sizeof(regs[i]));
+		*p = '\0';
+		if (bootverbose) {
+			/*
+			 * HV vendor	ID string
+			 * ------------+--------------
+			 * KVM		"KVMKVMKVM"
+			 * Microsoft	"Microsoft Hv"
+			 * VMware	"VMwareVMware"
+			 * Xen		"XenVMMXenVMM"
+			 */
+			printf("Hypervisor: Origin = \"%s\"\n", hv_sig);
+		}
+		if (strncmp(hv_sig, "VMwareVMware", 12) != 0)
+			return (0);
+	} else {
+		p = getenv("smbios.system.serial");
+		if (p == NULL)
+			return (0);
+		if (strncmp(p, "VMware-", 7) != 0 &&
+		    strncmp(p, "VMW", 3) != 0) {
+			freeenv(p);
+			return (0);
+		}
+		freeenv(p);
+		vmware_hvcall(VMW_HVCMD_GETVERSION, regs);
+		if (regs[1] != VMW_HVMAGIC)
+			return (0);
+	}
+	if (hv_high >= 0x40000010) {
+		do_cpuid(0x40000010, regs);
+		tsc_freq = regs[0] * 1000;
+	} else {
+		vmware_hvcall(VMW_HVCMD_GETHZ, regs);
+		if (regs[1] != UINT_MAX)
+			tsc_freq = regs[0] | ((uint64_t)regs[1] << 32);
+	}
+	tsc_is_invariant = 1;
+#ifdef SMP
+	smp_tsc = 1;	/* XXX */
+#endif
+	return (1);
+}
+
 static void
 tsc_freq_intel(void)
 {
@@ -102,7 +184,6 @@ tsc_freq_intel(void)
 	/*
 	 * Intel Processor Identification and the CPUID Instruction
 	 * Application Note 485.
-	 *
 	 * http://www.intel.com/assets/pdf/appnote/241618.pdf
 	 */
 	if (cpu_exthigh >= 0x80000004) {
@@ -156,6 +237,25 @@ probe_tsc_freq(void)
 	u_int regs[4];
 	uint64_t tsc1, tsc2;
 
+	if (cpu_high >= 6) {
+		do_cpuid(6, regs);
+		if ((regs[2] & CPUID_PERF_STAT) != 0) {
+			/*
+			 * XXX Some emulators expose host CPUID without actual
+			 * support for these MSRs.  We must test whether they
+			 * really work.
+			 */
+			wrmsr(MSR_MPERF, 0);
+			wrmsr(MSR_APERF, 0);
+			DELAY(10);
+			if (rdmsr(MSR_MPERF) > 0 && rdmsr(MSR_APERF) > 0)
+				tsc_perf_stat = 1;
+		}
+	}
+
+	if (tsc_freq_vmware())
+		return;
+
 	switch (cpu_vendor_id) {
 	case CPU_VENDOR_AMD:
 		if ((amd_pminfo & AMDPM_TSC_INVARIANT) != 0 ||
@@ -181,22 +281,6 @@ probe_tsc_freq(void)
 		break;
 	}
 
-	if (cpu_high >= 6) {
-		do_cpuid(6, regs);
-		if ((regs[2] & CPUID_PERF_STAT) != 0) {
-			/*
-			 * XXX Some emulators expose host CPUID without actual
-			 * support for these MSRs.  We must test whether they
-			 * really work.
-			 */
-			wrmsr(MSR_MPERF, 0);
-			wrmsr(MSR_APERF, 0);
-			DELAY(10);
-			if (rdmsr(MSR_MPERF) > 0 && rdmsr(MSR_APERF) > 0)
-				tsc_perf_stat = 1;
-		}
-	}
-
 	if (tsc_skip_calibration) {
 		if (cpu_vendor_id == CPU_VENDOR_INTEL)
 			tsc_freq_intel();

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 18:26:17 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA497106566B;
	Fri, 29 Apr 2011 18:26:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A13F88FC0A;
	Fri, 29 Apr 2011 18:26:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TIQH7G010111;
	Fri, 29 Apr 2011 18:26:17 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TIQHFt010109;
	Fri, 29 Apr 2011 18:26:17 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104291826.p3TIQHFt010109@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 18:26:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221215 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 18:26:17 -0000

Author: jhb
Date: Fri Apr 29 18:26:17 2011
New Revision: 221215
URL: http://svn.freebsd.org/changeset/base/221215

Log:
  Add the AH_SUPPORT_AR9130 option.

Modified:
  head/sys/conf/options

Modified: head/sys/conf/options
==============================================================================
--- head/sys/conf/options	Fri Apr 29 18:20:12 2011	(r221214)
+++ head/sys/conf/options	Fri Apr 29 18:26:17 2011	(r221215)
@@ -775,6 +775,7 @@ ATH_ENABLE_11N		opt_ah.h
 
 # options for the Atheros hal
 AH_SUPPORT_AR5416	opt_ah.h
+AH_SUPPORT_AR9130	opt_ah.h
 
 AH_DEBUG		opt_ah.h
 AH_ASSERT		opt_ah.h

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 18:27:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0F14106564A;
	Fri, 29 Apr 2011 18:27:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A8778FC15;
	Fri, 29 Apr 2011 18:27:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TIRo2l010188;
	Fri, 29 Apr 2011 18:27:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TIRoqa010186;
	Fri, 29 Apr 2011 18:27:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104291827.p3TIRoqa010186@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 18:27:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221216 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 18:27:50 -0000

Author: jhb
Date: Fri Apr 29 18:27:50 2011
New Revision: 221216
URL: http://svn.freebsd.org/changeset/base/221216

Log:
  Add the mipsn32eb TARGET_ARCH to the list of mips targets for the
  XLRN32 kernel config.
  
  Reviewed by:	imp, jmallet

Modified:
  head/Makefile

Modified: head/Makefile
==============================================================================
--- head/Makefile	Fri Apr 29 18:26:17 2011	(r221215)
+++ head/Makefile	Fri Apr 29 18:27:50 2011	(r221216)
@@ -325,7 +325,7 @@ toolchains:
 .if make(universe) || make(universe_kernels) || make(tinderbox) || make(targets)
 TARGETS?=amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v
 TARGET_ARCHES_arm?=	arm armeb
-TARGET_ARCHES_mips?=	mipsel mipseb mips64el mips64eb
+TARGET_ARCHES_mips?=	mipsel mipseb mips64el mips64eb mipsn32eb
 TARGET_ARCHES_powerpc?=	powerpc powerpc64
 TARGET_ARCHES_pc98?=	i386
 TARGET_ARCHES_sun4v?=	sparc64

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 18:41:21 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79A0A1065785;
	Fri, 29 Apr 2011 18:41:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 694F58FC12;
	Fri, 29 Apr 2011 18:41:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TIfLtI010704;
	Fri, 29 Apr 2011 18:41:21 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TIfLTn010695;
	Fri, 29 Apr 2011 18:41:21 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104291841.p3TIfLTn010695@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 18:41:21 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221218 - in head/sys: arm/arm dev/fdt ia64/ia64 kern
	mips/mips mips/rmi x86/x86
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 18:41:21 -0000

Author: jhb
Date: Fri Apr 29 18:41:21 2011
New Revision: 221218
URL: http://svn.freebsd.org/changeset/base/221218

Log:
  Change rman_manage_region() to actually honor the rm_start and rm_end
  constraints on the rman and reject attempts to manage a region that is out
  of range.
  - Fix various places that set rm_end incorrectly (to ~0 or ~0u instead of
    ~0ul).
  - To preserve existing behavior, change rman_init() to set rm_start and
    rm_end to allow managing the full range (0 to ~0ul) if they are not set by
    the caller when rman_init() is called.

Modified:
  head/sys/arm/arm/nexus.c
  head/sys/dev/fdt/fdtbus.c
  head/sys/ia64/ia64/nexus.c
  head/sys/kern/subr_rman.c
  head/sys/mips/mips/mainbus.c
  head/sys/mips/mips/nexus.c
  head/sys/mips/rmi/xlr_pci.c
  head/sys/x86/x86/nexus.c

Modified: head/sys/arm/arm/nexus.c
==============================================================================
--- head/sys/arm/arm/nexus.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/arm/arm/nexus.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -138,10 +138,10 @@ nexus_attach(device_t dev)
 {
 
 	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
+	mem_rman.rm_end = ~0ul;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "I/O memory addresses";
-	if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0u))
+	if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0))
 		panic("nexus_probe mem_rman");
 
 	/*

Modified: head/sys/dev/fdt/fdtbus.c
==============================================================================
--- head/sys/dev/fdt/fdtbus.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/dev/fdt/fdtbus.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -206,7 +206,7 @@ fdtbus_attach(device_t dev)
 	 * Mem-mapped I/O space rman.
 	 */
 	start = 0;
-	end = ~0u;
+	end = ~0ul;
 	sc->sc_mem.rm_start = start;
 	sc->sc_mem.rm_end = end;
 	sc->sc_mem.rm_type = RMAN_ARRAY;

Modified: head/sys/ia64/ia64/nexus.c
==============================================================================
--- head/sys/ia64/ia64/nexus.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/ia64/ia64/nexus.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -174,7 +174,7 @@ nexus_probe(device_t dev)
 		panic("nexus_probe port_rman");
 
 	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
+	mem_rman.rm_end = ~0ul;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "I/O memory addresses";
 	if (rman_init(&mem_rman)

Modified: head/sys/kern/subr_rman.c
==============================================================================
--- head/sys/kern/subr_rman.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/kern/subr_rman.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -138,6 +138,8 @@ rman_init(struct rman *rm)
 		mtx_init(&rman_mtx, "rman head", NULL, MTX_DEF);
 	}
 
+	if (rm->rm_start == 0 && rm->rm_end == 0)
+		rm->rm_end = ~0ul;
 	if (rm->rm_type == RMAN_UNINIT)
 		panic("rman_init");
 	if (rm->rm_type == RMAN_GAUGE)
@@ -162,6 +164,8 @@ rman_manage_region(struct rman *rm, u_lo
 
 	DPRINTF(("rman_manage_region: <%s> request: start %#lx, end %#lx\n",
 	    rm->rm_descr, start, end));
+	if (start < rm->rm_start || end > rm->rm_end)
+		return EINVAL;
 	r = int_alloc_resource(M_NOWAIT);
 	if (r == NULL)
 		return ENOMEM;

Modified: head/sys/mips/mips/mainbus.c
==============================================================================
--- head/sys/mips/mips/mainbus.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/mips/mips/mainbus.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -146,7 +146,7 @@ mainbus_probe(device_t dev)
 		panic("mainbus_probe port_rman");
 
 	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
+	mem_rman.rm_end = ~0ul;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "I/O memory addresses";
 	if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0))

Modified: head/sys/mips/mips/nexus.c
==============================================================================
--- head/sys/mips/mips/nexus.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/mips/mips/nexus.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -151,7 +151,7 @@ nexus_probe(device_t dev)
 	}
 
 	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
+	mem_rman.rm_end = ~0ul;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "Memory addresses";
 	if (rman_init(&mem_rman) != 0 ||

Modified: head/sys/mips/rmi/xlr_pci.c
==============================================================================
--- head/sys/mips/rmi/xlr_pci.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/mips/rmi/xlr_pci.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -126,7 +126,7 @@ xlr_pci_init_resources(void)
 		panic("pci_init_resources irq_rman");
 
 	port_rman.rm_start = 0;
-	port_rman.rm_end = ~0u;
+	port_rman.rm_end = ~0ul;
 	port_rman.rm_type = RMAN_ARRAY;
 	port_rman.rm_descr = "I/O ports";
 	if (rman_init(&port_rman)
@@ -134,7 +134,7 @@ xlr_pci_init_resources(void)
 		panic("pci_init_resources port_rman");
 
 	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
+	mem_rman.rm_end = ~0ul;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "I/O memory";
 	if (rman_init(&mem_rman)

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Fri Apr 29 18:30:53 2011	(r221217)
+++ head/sys/x86/x86/nexus.c	Fri Apr 29 18:41:21 2011	(r221218)
@@ -256,7 +256,7 @@ nexus_init_resources(void)
 		panic("nexus_init_resources port_rman");
 
 	mem_rman.rm_start = 0;
-	mem_rman.rm_end = ~0u;
+	mem_rman.rm_end = ~0ul;
 	mem_rman.rm_type = RMAN_ARRAY;
 	mem_rman.rm_descr = "I/O memory addresses";
 	if (rman_init(&mem_rman)

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 19:00:01 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6F12C106566B
	for ; Fri, 29 Apr 2011 19:00:01 +0000 (UTC)
	(envelope-from markm@FreeBSD.org)
Received: from gromit.grondar.org (grandfather.grondar.org
	[IPv6:2a01:348:0:15:5d59:5c20:0:2])
	by mx1.freebsd.org (Postfix) with ESMTP id 29C258FC13
	for ; Fri, 29 Apr 2011 19:00:01 +0000 (UTC)
Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.73
	(FreeBSD)) (envelope-from ) id 1QFs8m-000AF0-7R
	for svn-src-head@freebsd.org; Fri, 29 Apr 2011 19:10:08 +0100
Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org)
	by groundzero.grondar.org with esmtp (Exim 4.75 (FreeBSD))
	(envelope-from )
	id 1QFs68-0003B2-1S; Fri, 29 Apr 2011 19:07:24 +0100
To: obrien@FreeBSD.org
In-reply-to: <20110426044507.GA8767@dragon.NUXI.org>
References: <201104091402.p39E24bm016157@svn.freebsd.org>
	<20110426044507.GA8767@dragon.NUXI.org>
From: Mark Murray 
Date: Fri, 29 Apr 2011 19:07:23 +0100
Message-Id: 
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r220497 - head/lib/libcrypt
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 19:00:01 -0000

"David O'Brien" writes:
> On Sat, Apr 09, 2011 at 02:02:04PM +0000, Mark Murray wrote:
> > Log:
> >   Add SHA256/512 ($5$ and $6$) to crypt(3). Used in linux-world, doesn't
> >   hurt us.
> 
> Would you mind if I committed this to be a more consistent with the
> existing naming?

Be my guest.

M
--
Mark R V Murray
Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open)
Pi: 132511160


From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 20:05:20 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2FA50106566C;
	Fri, 29 Apr 2011 20:05:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 155038FC13;
	Fri, 29 Apr 2011 20:05:20 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TK5Kp1013278;
	Fri, 29 Apr 2011 20:05:20 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TK5Kd9013273;
	Fri, 29 Apr 2011 20:05:20 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104292005.p3TK5Kd9013273@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 20:05:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221220 - in head: share/man/man9 sys/kern sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 20:05:20 -0000

Author: jhb
Date: Fri Apr 29 20:05:19 2011
New Revision: 221220
URL: http://svn.freebsd.org/changeset/base/221220

Log:
  Extend the rman(9) API to support altering an existing resource.
  Specifically, these changes allow a resource to back a relocatable and
  resizable resource such as the I/O window decoders in PCI-PCI bridges.
  - rman_adjust_resource() can adjust the start and end address of an
    existing resource.  It only succeeds if the newly requested address
    space is already free.  It also supports shrinking a resource in
    which case the freed space will be marked unallocated in the rman.
  - rman_first_free_region() and rman_last_free_region() return the
    start and end addresses for the first or last unallocated region in
    an rman, respectively.  This can be used to determine by how much
    the resource backing an rman must be adjusted to accomodate an
    allocation request that does not fit into the existing rman.
  
  While here, document the rm_start and rm_end fields in struct rman,
  rman_is_region_manager(), the bound argument to
  rman_reserve_resource_bound(), and rman_init_from_resource().

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/rman.9
  head/sys/kern/subr_rman.c
  head/sys/sys/rman.h

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Fri Apr 29 18:49:36 2011	(r221219)
+++ head/share/man/man9/Makefile	Fri Apr 29 20:05:19 2011	(r221220)
@@ -967,9 +967,11 @@ MLINKS+=refcount.9 refcount_acquire.9 \
 MLINKS+=resource_int_value.9 resource_long_value.9 \
 	resource_int_value.9 resource_string_value.9
 MLINKS+=rman.9 rman_activate_resource.9 \
+	rman.9 rman_adjust_resource.9 \
 	rman.9 rman_await_resource.9 \
 	rman.9 rman_deactivate_resource.9 \
 	rman.9 rman_fini.9 \
+	rman.9 rman_first_free_region.9 \
 	rman.9 rman_get_bushandle.9 \
 	rman.9 rman_get_bustag.9 \
 	rman.9 rman_get_device.9 \
@@ -980,6 +982,9 @@ MLINKS+=rman.9 rman_activate_resource.9 
 	rman.9 rman_get_start.9 \
 	rman.9 rman_get_virtual.9 \
 	rman.9 rman_init.9 \
+	rman.9 rman_init_from_resource.9 \
+	rman.9 rman_is_region_manager.9 \
+	rman.9 rman_last_free_region.9 \
 	rman.9 rman_make_alignment_flags.9 \
 	rman.9 rman_manage_region.9 \
 	rman.9 rman_release_resource.9 \

Modified: head/share/man/man9/rman.9
==============================================================================
--- head/share/man/man9/rman.9	Fri Apr 29 18:49:36 2011	(r221219)
+++ head/share/man/man9/rman.9	Fri Apr 29 20:05:19 2011	(r221220)
@@ -25,17 +25,22 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 29, 2007
+.Dd April 29, 2011
 .Dt RMAN 9
 .Os
 .Sh NAME
 .Nm rman ,
 .Nm rman_activate_resource ,
+.Nm rman_adjust_resource ,
 .Nm rman_await_resource ,
 .Nm rman_deactivate_resource ,
 .Nm rman_fini ,
 .Nm rman_init ,
+.Nm rman_init_from_resource ,
+.Nm rman_is_region_manager ,
 .Nm rman_manage_region ,
+.Nm rman_first_free_region ,
+.Nm rman_last_free_region ,
 .Nm rman_release_resource ,
 .Nm rman_reserve_resource ,
 .Nm rman_reserve_resource_bound ,
@@ -60,6 +65,8 @@
 .Ft int
 .Fn rman_activate_resource "struct resource *r"
 .Ft int
+.Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end"
+.Ft int
 .Fn rman_await_resource "struct resource *r" "int pri2" "int timo"
 .Ft int
 .Fn rman_deactivate_resource "struct resource *r"
@@ -68,8 +75,16 @@
 .Ft int
 .Fn rman_init "struct rman *rm"
 .Ft int
+.Fn rman_init_from_resource "struct rman *rm" "struct resource *r"
+.Ft int
+.Fn rman_is_region_manager "struct resource *r" "struct rman *rm"
+.Ft int
 .Fn rman_manage_region "struct rman *rm" "u_long start" "u_long end"
 .Ft int
+.Fn rman_first_free_region "struct rman *rm" "u_long *start" "u_long *end"
+.Ft int
+.Fn rman_last_free_region "struct rman *rm" "u_long *start" "u_long *end"
+.Ft int
 .Fn rman_release_resource "struct resource *r"
 .Ft "struct resource *"
 .Fo rman_reserve_resource
@@ -155,6 +170,14 @@ shall be set to
 The field
 .Va rm_descr
 shall be set to a string that describes the resource to be managed.
+The
+.Va rm_start
+and
+.Va rm_end
+fields may be set to limit the range of acceptable resource addresses.
+If these fields are not set,
+.Fn rman_init
+will initialize them to allow the entire range of resource addresses.
 It also initializes any mutexes associated with the structure.
 If
 .Fn rman_init
@@ -194,12 +217,49 @@ If successful,
 will return 0.
 If the region overlaps with an existing region, it will return
 .Er EBUSY .
+If any part of the region falls outside of the valid address range for
+.Fa rm ,
+it will return
+.Er EINVAL .
 .Er ENOMEM
-will be return when
+will be returned when
 .Fn rman_manage_region
 failed to allocate memory for the region.
 .Pp
 The
+.Fn rman_init_from_resource
+function is a wrapper routine to create a resource manager backed by an
+existing resource.
+It initializes
+.Fa rm
+using
+.Fn rman_init
+and then adds a region to
+.Fa rm
+corresponding to the address range allocated to
+.Fa r
+via
+.Fn rman_manage_region .
+.Pp
+The
+.Fn rman_first_free_region
+and
+.Fn rman_last_free_region
+functions can be used to query a resource manager for its first
+.Pq or last
+unallocated region.
+If
+.Fa rm
+contains no free region,
+these functions will return
+.Er ENOENT .
+Otherwise,
+.Fa *start
+and
+.Fa *end
+are set to the bounds of the free region and zero is returned.
+.Pp
+The
 .Fn rman_reserve_resource_bound
 function is where the bulk of the
 .Nm
@@ -212,8 +272,9 @@ The caller can specify the
 .Fa start
 and
 .Fa end
-of an acceptable range, as well as
-alignment, and the code will attempt to find a free segment which fits.
+of an acceptable range,
+as well as a boundary restriction and required aligment,
+and the code will attempt to find a free segment which fits.
 The
 .Fa start
 argument is the lowest acceptable starting value of the resource.
@@ -225,6 +286,19 @@ Therefore,
 must be \[<=]
 .Fa end
 for any allocation to happen.
+The aligment requirement
+.Pq if any
+is specified in
+.Fa flags .
+The
+.Fa bound
+argument may be set to specify a boundary restriction such that an
+allocated region may cross an address that is a multiple of the
+boundary.
+The
+.Fa bound
+argument must be a power of two.
+It may be set to zero to specify no boundary restriction.
 The default behavior is to allocate an exclusive segment, unless the
 .Dv RF_SHAREABLE
 or
@@ -240,7 +314,7 @@ function is used to reserve resources wi
 It is a simplified interface to
 .Fn rman_reserve_resource_bound
 which passes 0 for the
-.Fa flags
+.Fa bound
 argument.
 .Pp
 The
@@ -251,6 +325,49 @@ This should be used when calling
 .Fn rman_reserve_resource_bound .
 .Pp
 The
+.Fn rman_is_region_manager
+function returns true if the allocated resource
+.Fa r
+was allocated from
+.Fa rm .
+Otherwise,
+it returns false.
+.Pp
+The
+.Fn rman_adjust_resource
+function is used to adjust the reserved address range of an allocated resource
+to reserve
+.Fa start
+through
+.Fa end .
+It can be used to grow or shrink one or both ends of the resource range.
+The current implementation does not support entirely relocating the resource
+and will fail with
+.Er EINVAL
+if the new resource range does not overlap the old resource range.
+If either end of the resource range grows and the new resource range would
+conflict with another allocated resource,
+the function will fail with
+.Er EBUSY .
+The
+.Fn rman_adjust_resource
+function does not support adjusting the resource range for shared resources
+and will fail such attempts with
+.Er EINVAL .
+Upon success,
+the resource
+.Fa r
+will have a start address of
+.Fa start
+and an end address of
+.Fa end
+and the function will return zero.
+Note that none of the constraints of the original allocation request such
+as alignment or boundary restrictions are checked by
+.Fn rman_adjust_resource .
+It is the caller's responsibility to enforce any such requirements.
+.Pp
+The
 .Fn rman_release_resource
 function releases the reserved resource
 .Fa r .

Modified: head/sys/kern/subr_rman.c
==============================================================================
--- head/sys/kern/subr_rman.c	Fri Apr 29 18:49:36 2011	(r221219)
+++ head/sys/kern/subr_rman.c	Fri Apr 29 20:05:19 2011	(r221220)
@@ -272,6 +272,164 @@ rman_fini(struct rman *rm)
 	return 0;
 }
 
+int
+rman_first_free_region(struct rman *rm, u_long *start, u_long *end)
+{
+	struct resource_i *r;
+
+	mtx_lock(rm->rm_mtx);
+	TAILQ_FOREACH(r, &rm->rm_list, r_link) {
+		if (!(r->r_flags & RF_ALLOCATED)) {
+			*start = r->r_start;
+			*end = r->r_end;
+			mtx_unlock(rm->rm_mtx);
+			return (0);
+		}
+	}
+	mtx_unlock(rm->rm_mtx);
+	return (ENOENT);
+}
+
+int
+rman_last_free_region(struct rman *rm, u_long *start, u_long *end)
+{
+	struct resource_i *r;
+
+	mtx_lock(rm->rm_mtx);
+	TAILQ_FOREACH_REVERSE(r, &rm->rm_list, resource_head, r_link) {
+		if (!(r->r_flags & RF_ALLOCATED)) {
+			*start = r->r_start;
+			*end = r->r_end;
+			mtx_unlock(rm->rm_mtx);
+			return (0);
+		}
+	}
+	mtx_unlock(rm->rm_mtx);
+	return (ENOENT);
+}
+
+/* Shrink or extend one or both ends of an allocated resource. */
+int
+rman_adjust_resource(struct resource *rr, u_long start, u_long end)
+{
+	struct	resource_i *r, *s, *t, *new;
+	struct	rman *rm;
+
+	/* Not supported for shared resources. */
+	r = rr->__r_i;
+	if (r->r_flags & (RF_TIMESHARE | RF_SHAREABLE))
+		return (EINVAL);
+
+	/*
+	 * This does not support wholesale moving of a resource.  At
+	 * least part of the desired new range must overlap with the
+	 * existing resource.
+	 */
+	if (end < r->r_start || r->r_end < start)
+		return (EINVAL);
+
+	/*
+	 * Find the two resource regions immediately adjacent to the
+	 * allocated resource.
+	 */
+	rm = r->r_rm;
+	mtx_lock(rm->rm_mtx);
+#ifdef INVARIANTS
+	TAILQ_FOREACH(s, &rm->rm_list, r_link) {
+		if (s == r)
+			break;
+	}
+	if (s == NULL)
+		panic("resource not in list");
+#endif
+	s = TAILQ_PREV(r, resource_head, r_link);
+	t = TAILQ_NEXT(r, r_link);
+	KASSERT(s == NULL || s->r_end + 1 == r->r_start,
+	    ("prev resource mismatch"));
+	KASSERT(t == NULL || r->r_end + 1 == t->r_start,
+	    ("next resource mismatch"));
+
+	/*
+	 * See if the changes are permitted.  Shrinking is always allowed,
+	 * but growing requires sufficient room in the adjacent region.
+	 */
+	if (start < r->r_start && (s == NULL || (s->r_flags & RF_ALLOCATED) ||
+	    s->r_start > start)) {
+		mtx_unlock(rm->rm_mtx);
+		return (EBUSY);
+	}
+	if (end > r->r_end && (t == NULL || (t->r_flags & RF_ALLOCATED) ||
+	    t->r_end < end)) {
+		mtx_unlock(rm->rm_mtx);
+		return (EBUSY);
+	}
+
+	/*
+	 * While holding the lock, grow either end of the resource as
+	 * needed and shrink either end if the shrinking does not require
+	 * allocating a new resource.  We can safely drop the lock and then
+	 * insert a new range to handle the shrinking case afterwards.
+	 */
+	if (start < r->r_start ||
+	    (start > r->r_start && s != NULL && !(s->r_flags & RF_ALLOCATED))) {
+		KASSERT(s->r_flags == 0, ("prev is busy"));
+		r->r_start = start;
+		if (s->r_start == start) {
+			TAILQ_REMOVE(&rm->rm_list, s, r_link);
+			free(s, M_RMAN);
+		} else
+			s->r_end = start - 1;
+	}
+	if (end > r->r_end ||
+	    (end < r->r_end && t != NULL && !(t->r_flags & RF_ALLOCATED))) {
+		KASSERT(t->r_flags == 0, ("next is busy"));
+		r->r_end = end;
+		if (t->r_end == end) {
+			TAILQ_REMOVE(&rm->rm_list, t, r_link);
+			free(t, M_RMAN);
+		} else
+			t->r_start = end + 1;
+	}
+	mtx_unlock(rm->rm_mtx);
+
+	/*
+	 * Handle the shrinking cases that require allocating a new
+	 * resource to hold the newly-free region.  We have to recheck
+	 * if we still need this new region after acquiring the lock.
+	 */
+	if (start > r->r_start) {
+		new = int_alloc_resource(M_WAITOK);
+		new->r_start = r->r_start;
+		new->r_end = start - 1;
+		new->r_rm = rm;
+		mtx_lock(rm->rm_mtx);
+		r->r_start = start;
+		s = TAILQ_PREV(r, resource_head, r_link);
+		if (s != NULL && !(s->r_flags & RF_ALLOCATED)) {
+			s->r_end = start - 1;
+			free(new, M_RMAN);
+		} else
+			TAILQ_INSERT_BEFORE(r, new, r_link);
+		mtx_unlock(rm->rm_mtx);
+	}
+	if (end < r->r_end) {
+		new = int_alloc_resource(M_WAITOK);
+		new->r_start = end + 1;
+		new->r_end = r->r_end;
+		new->r_rm = rm;
+		mtx_lock(rm->rm_mtx);
+		r->r_end = end;
+		t = TAILQ_NEXT(r, r_link);
+		if (t != NULL && !(t->r_flags & RF_ALLOCATED)) {
+			t->r_start = end + 1;
+			free(new, M_RMAN);
+		} else
+			TAILQ_INSERT_AFTER(&rm->rm_list, r, new, r_link);
+		mtx_unlock(rm->rm_mtx);
+	}
+	return (0);
+}
+
 struct resource *
 rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end,
 		      u_long count, u_long bound,  u_int flags,

Modified: head/sys/sys/rman.h
==============================================================================
--- head/sys/sys/rman.h	Fri Apr 29 18:49:36 2011	(r221219)
+++ head/sys/sys/rman.h	Fri Apr 29 20:05:19 2011	(r221220)
@@ -116,7 +116,9 @@ struct rman {
 TAILQ_HEAD(rman_head, rman);
 
 int	rman_activate_resource(struct resource *r);
+int	rman_adjust_resource(struct resource *r, u_long start, u_long end);
 int	rman_await_resource(struct resource *r, int pri, int timo);
+int	rman_first_free_region(struct rman *rm, u_long *start, u_long *end);
 bus_space_handle_t rman_get_bushandle(struct resource *);
 bus_space_tag_t rman_get_bustag(struct resource *);
 u_long	rman_get_end(struct resource *);
@@ -130,6 +132,7 @@ int	rman_deactivate_resource(struct reso
 int	rman_fini(struct rman *rm);
 int	rman_init(struct rman *rm);
 int	rman_init_from_resource(struct rman *rm, struct resource *r);
+int	rman_last_free_region(struct rman *rm, u_long *start, u_long *end);
 uint32_t rman_make_alignment_flags(uint32_t size);
 int	rman_manage_region(struct rman *rm, u_long start, u_long end);
 int	rman_is_region_manager(struct resource *r, struct rman *rm);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 21:10:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7AFFA106564A;
	Fri, 29 Apr 2011 21:10:41 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B1088FC16;
	Fri, 29 Apr 2011 21:10:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TLAfKm015736;
	Fri, 29 Apr 2011 21:10:41 GMT (envelope-from dougb@svn.freebsd.org)
Received: (from dougb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TLAfp4015734;
	Fri, 29 Apr 2011 21:10:41 GMT (envelope-from dougb@svn.freebsd.org)
Message-Id: <201104292110.p3TLAfp4015734@svn.freebsd.org>
From: Doug Barton 
Date: Fri, 29 Apr 2011 21:10:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221227 - head/etc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 21:10:41 -0000

Author: dougb
Date: Fri Apr 29 21:10:41 2011
New Revision: 221227
URL: http://svn.freebsd.org/changeset/base/221227

Log:
  Rather than trusting that nothing is going to sneak in before the
  early_late_divider in the second run (and thus be skipped altogether),
  keep a list of the scripts run early, and use that list to skip things
  in the second run.
  
  This has the primary benefit of not skipping a local script that gets
  ordered too early in the second run. It also gives an opportunity to
  clean up/simplify the code a bit.
  
  Use a space-separated list rather than the more traditional colon for
  maximum insurance against creativity in local naming conventions.
  
  Reviewed by:	brooks

Modified:
  head/etc/rc

Modified: head/etc/rc
==============================================================================
--- head/etc/rc	Fri Apr 29 21:09:03 2011	(r221226)
+++ head/etc/rc	Fri Apr 29 21:10:41 2011	(r221227)
@@ -84,8 +84,10 @@ fi
 #
 files=`rcorder ${skip} /etc/rc.d/* 2>/dev/null`
 
+_rc_elem_done=' '
 for _rc_elem in ${files}; do
 	run_rc_script ${_rc_elem} ${_boot}
+	_rc_elem_done="${_rc_elem_done}${_rc_elem} "
 
 	case "$_rc_elem" in
 	*/${early_late_divider})	break ;;
@@ -103,14 +105,9 @@ case ${local_startup} in
 esac
 
 files=`rcorder ${skip} /etc/rc.d/* ${local_rc} 2>/dev/null`
-_skip_early=1
 for _rc_elem in ${files}; do
-	case "$_skip_early" in
-	1)	case "$_rc_elem" in
-		*/${early_late_divider})	_skip_early=0 ;;
-		esac
-		continue
-		;;
+	case "$_rc_elem_done" in
+	*" $_rc_elem "*)	continue ;;
 	esac
 
 	run_rc_script ${_rc_elem} ${_boot}

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 21:18:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8DAA11065673;
	Fri, 29 Apr 2011 21:18:41 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 62A368FC14;
	Fri, 29 Apr 2011 21:18:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TLIfg3016067;
	Fri, 29 Apr 2011 21:18:41 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TLIf56016065;
	Fri, 29 Apr 2011 21:18:41 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104292118.p3TLIf56016065@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Fri, 29 Apr 2011 21:18:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221229 - head/sys/dev/md
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 21:18:41 -0000

Author: des
Date: Fri Apr 29 21:18:41 2011
New Revision: 221229
URL: http://svn.freebsd.org/changeset/base/221229

Log:
  Implement BIO_DELETE for vnode devices by simply overwriting the deleted
  sectors with all-zeroes.
  
  The zeroes come from a static buffer; null(4) uses a dynamic buffer for
  the same purpose (for /dev/zero).  It might be a good idea to have a
  static, shared, read-only all-zeroes page somewhere in the kernel that
  md(4), null(4) and any other code that needs zeroes could use.
  
  Reviewed by:	kib
  MFC after:	3 weeks

Modified:
  head/sys/dev/md/md.c

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c	Fri Apr 29 21:10:45 2011	(r221228)
+++ head/sys/dev/md/md.c	Fri Apr 29 21:18:41 2011	(r221229)
@@ -205,6 +205,9 @@ struct md_s {
 	vm_object_t object;
 };
 
+/* Used for BIO_DELETE on MD_VNODE */
+static u_char zero[PAGE_SIZE];
+
 static struct indir *
 new_indir(u_int shift)
 {
@@ -514,10 +517,12 @@ mdstart_vnode(struct md_s *sc, struct bi
 	struct mount *mp;
 	struct vnode *vp;
 	struct thread *td;
+	off_t end, zerosize;
 
 	switch (bp->bio_cmd) {
 	case BIO_READ:
 	case BIO_WRITE:
+	case BIO_DELETE:
 	case BIO_FLUSH:
 		break;
 	default:
@@ -548,6 +553,43 @@ mdstart_vnode(struct md_s *sc, struct bi
 
 	bzero(&auio, sizeof(auio));
 
+	/*
+	 * Special case for BIO_DELETE.  On the surface, this is very
+	 * similar to BIO_WRITE, except that we write from our own
+	 * fixed-length buffer, so we have to loop.  The net result is
+	 * that the two cases end up having very little in common.
+	 */
+	if (bp->bio_cmd == BIO_DELETE) {
+		zerosize = sizeof(zero) - (sizeof(zero) % sc->sectorsize);
+		auio.uio_iov = &aiov;
+		auio.uio_iovcnt = 1;
+		auio.uio_offset = (vm_ooffset_t)bp->bio_offset;
+		auio.uio_segflg = UIO_SYSSPACE;
+		auio.uio_rw = UIO_WRITE;
+		auio.uio_td = td;
+		end = bp->bio_offset + bp->bio_length;
+		vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+		(void) vn_start_write(vp, &mp, V_WAIT);
+		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+		error = 0;
+		while (auio.uio_offset < end) {
+			aiov.iov_base = zero;
+			aiov.iov_len = end - auio.uio_offset;
+			if (aiov.iov_len > zerosize)
+				aiov.iov_len = zerosize;
+			auio.uio_resid = aiov.iov_len;
+			error = VOP_WRITE(vp, &auio,
+			    sc->flags & MD_ASYNC ? 0 : IO_SYNC, sc->cred);
+			if (error != 0)
+				break;
+		}
+		VOP_UNLOCK(vp, 0);
+		vn_finished_write(mp);
+		bp->bio_resid = end - auio.uio_offset;
+		VFS_UNLOCK_GIANT(vfslocked);
+		return (error);
+	}
+
 	aiov.iov_base = bp->bio_data;
 	aiov.iov_len = bp->bio_length;
 	auio.uio_iov = &aiov;

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 21:36:45 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA0361065673;
	Fri, 29 Apr 2011 21:36:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A721B8FC16;
	Fri, 29 Apr 2011 21:36:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TLajbD016699;
	Fri, 29 Apr 2011 21:36:45 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TLajgP016691;
	Fri, 29 Apr 2011 21:36:45 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201104292136.p3TLajgP016691@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 29 Apr 2011 21:36:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221231 - in head: share/man/man9 sys/kern sys/sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 21:36:45 -0000

Author: jhb
Date: Fri Apr 29 21:36:45 2011
New Revision: 221231
URL: http://svn.freebsd.org/changeset/base/221231

Log:
  Add a new bus method, BUS_ADJUST_RESOURCE() that is intended to be a
  wrapper around rman_adjust_resource().  Include a generic implementation,
  bus_generic_adjust_resource() which passes the request up to the parent
  bus.  There is currently no default implementation.  A
  bus_adjust_resource() wrapper is provided for use in drivers.

Added:
  head/share/man/man9/bus_adjust_resource.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/bus_alloc_resource.9
  head/share/man/man9/rman.9
  head/sys/kern/bus_if.m
  head/sys/kern/subr_bus.c
  head/sys/sys/bus.h

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Fri Apr 29 21:19:30 2011	(r221230)
+++ head/share/man/man9/Makefile	Fri Apr 29 21:36:45 2011	(r221231)
@@ -21,6 +21,7 @@ MAN=	accept_filter.9 \
 	BUF_UNLOCK.9 \
 	bus_activate_resource.9 \
 	BUS_ADD_CHILD.9 \
+	bus_adjust_resource.9 \
 	bus_alloc_resource.9 \
 	BUS_BIND_INTR.9 \
 	bus_child_present.9 \

Added: head/share/man/man9/bus_adjust_resource.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/bus_adjust_resource.9	Fri Apr 29 21:36:45 2011	(r221231)
@@ -0,0 +1,101 @@
+.\" -*- nroff -*-
+.\"
+.\" Copyright (c) 2011 Advanced Computing Technologies LLC
+.\" Written by: John H. Baldwin 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 29, 2011
+.Dt BUS_ADJUST_RESOURCE 9
+.Os
+.Sh NAME
+.Nm bus_adjust_resource
+.Nd adjust resource allocated from a parent bus
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/bus.h
+.Pp
+.In machine/bus.h
+.In sys/rman.h
+.In machine/resource.h
+.Ft int
+.Fn bus_adjust_resource "device_t dev" "int type" "struct resource *r" "u_long start" "u_long end"
+.Sh DESCRIPTION
+This function is used to ask the parent bus to adjust the resource range
+assigned to an allocated resource.
+The resource
+.Fa r
+should have been allocated by a previous call to
+.Xr bus_alloc_resource 9 .
+The new resource range must overlap the existing range of
+.Fa r .
+The
+.Fa type
+argument should match the
+.Fa type
+argument passed to
+.Xr bus_alloc_resource 9
+when the resource was initially allocated.
+.Pp
+Note that none of the constraints of the original allocation request such
+as alignment or boundary restrictions are checked by
+.Fn bus_adjust_resource .
+It is the caller's responsibility to enforce any such requirements.
+.Sh RETURN VALUES
+The
+.Fn bus_adjust_resource
+method returns zero on success or an error code on failure.
+.Sh ERRORS
+.Fn bus_adjust_resource
+will fail if:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+The
+.Fa dev
+device does not have a parent device.
+.It Bq Er EINVAL
+The
+.Fa r
+resource is a shared resource.
+.It Bq Er EINVAL
+The new address range does not overlap with the existing address range of
+.Fa r .
+.It Bq Er EBUSY
+The new address range conflicts with another allocated resource.
+.El
+.Sh EXAMPLES
+Grow an existing memory resource by 4096 bytes.
+.Bd -literal
+	struct resource *res;
+	int error;
+
+	error = bus_adjust_resource(dev, SYS_RES_MEMORY, res,
+	    rman_get_start(res), rman_get_end(res) + 0x1000);
+.Ed		
+.Sh SEE ALSO
+.Xr bus_alloc_resource 9 ,
+.Xr bus_release_resource 9 ,
+.Xr device 9 ,
+.Xr driver 9

Modified: head/share/man/man9/bus_alloc_resource.9
==============================================================================
--- head/share/man/man9/bus_alloc_resource.9	Fri Apr 29 21:19:30 2011	(r221230)
+++ head/share/man/man9/bus_alloc_resource.9	Fri Apr 29 21:36:45 2011	(r221231)
@@ -171,6 +171,7 @@ should be saved in the softc of the devi
 .Ed
 .Sh SEE ALSO
 .Xr bus_activate_resource 9 ,
+.Xr bus_adjust_resource 9 ,
 .Xr bus_release_resource 9 ,
 .Xr device 9 ,
 .Xr driver 9

Modified: head/share/man/man9/rman.9
==============================================================================
--- head/share/man/man9/rman.9	Fri Apr 29 21:19:30 2011	(r221230)
+++ head/share/man/man9/rman.9	Fri Apr 29 21:36:45 2011	(r221231)
@@ -462,6 +462,7 @@ function returns a pointer to the device
 .Fa r .
 .Sh SEE ALSO
 .Xr bus_activate_resource 9 ,
+.Xr bus_adjust_resource 9 ,
 .Xr bus_alloc_resource 9 ,
 .Xr bus_release_resource 9 ,
 .Xr bus_set_resource 9 ,

Modified: head/sys/kern/bus_if.m
==============================================================================
--- head/sys/kern/bus_if.m	Fri Apr 29 21:19:30 2011	(r221230)
+++ head/sys/kern/bus_if.m	Fri Apr 29 21:36:45 2011	(r221231)
@@ -297,6 +297,30 @@ METHOD int deactivate_resource {
 };
 
 /**
+ * @brief Adjust a resource
+ *
+ * Adjust the start and/or end of a resource allocated by
+ * BUS_ALLOC_RESOURCE.  At least part of the new address range must overlap
+ * with the existing address range.  If the successful, the resource's range
+ * will be adjusted to [start, end] on return.
+ *
+ * @param _dev		the parent device of @p _child
+ * @param _child	the device which allocated the resource
+ * @param _type		the type of resource
+ * @param _res		the resource to adjust
+ * @param _start	the new starting address of the resource range
+ * @param _end		the new ending address of the resource range
+ */
+METHOD int adjust_resource {
+	device_t	_dev;
+	device_t	_child;
+	int		_type;
+	struct resource *_res;
+	u_long		_start;
+	u_long		_end;
+};
+
+/**
  * @brief Release a resource
  *
  * Free a resource allocated by the BUS_ALLOC_RESOURCE.  The @p _rid

Modified: head/sys/kern/subr_bus.c
==============================================================================
--- head/sys/kern/subr_bus.c	Fri Apr 29 21:19:30 2011	(r221230)
+++ head/sys/kern/subr_bus.c	Fri Apr 29 21:36:45 2011	(r221231)
@@ -3646,6 +3646,23 @@ bus_generic_teardown_intr(device_t dev, 
 }
 
 /**
+ * @brief Helper function for implementing BUS_ADJUST_RESOURCE().
+ *
+ * This simple implementation of BUS_ADJUST_RESOURCE() simply calls the
+ * BUS_ADJUST_RESOURCE() method of the parent of @p dev.
+ */
+int
+bus_generic_adjust_resource(device_t dev, device_t child, int type,
+    struct resource *r, u_long start, u_long end)
+{
+	/* Propagate up the bus hierarchy until someone handles it. */
+	if (dev->parent)
+		return (BUS_ADJUST_RESOURCE(dev->parent, child, type, r, start,
+		    end));
+	return (EINVAL);
+}
+
+/**
  * @brief Helper function for implementing BUS_ALLOC_RESOURCE().
  *
  * This simple implementation of BUS_ALLOC_RESOURCE() simply calls the
@@ -3976,6 +3993,21 @@ bus_alloc_resource(device_t dev, int typ
 }
 
 /**
+ * @brief Wrapper function for BUS_ADJUST_RESOURCE().
+ *
+ * This function simply calls the BUS_ADJUST_RESOURCE() method of the
+ * parent of @p dev.
+ */
+int
+bus_adjust_resource(device_t dev, int type, struct resource *r, u_long start,
+    u_long end)
+{
+	if (dev->parent == NULL)
+		return (EINVAL);
+	return (BUS_ADJUST_RESOURCE(dev->parent, dev, type, r, start, end));
+}
+
+/**
  * @brief Wrapper function for BUS_ACTIVATE_RESOURCE().
  *
  * This function simply calls the BUS_ACTIVATE_RESOURCE() method of the

Modified: head/sys/sys/bus.h
==============================================================================
--- head/sys/sys/bus.h	Fri Apr 29 21:19:30 2011	(r221230)
+++ head/sys/sys/bus.h	Fri Apr 29 21:36:45 2011	(r221231)
@@ -304,6 +304,9 @@ int	bus_generic_activate_resource(device
 device_t
 	bus_generic_add_child(device_t dev, u_int order, const char *name,
 			      int unit);
+int	bus_generic_adjust_resource(device_t bus, device_t child, int type,
+				    struct resource *r, u_long start,
+				    u_long end);
 struct resource *
 	bus_generic_alloc_resource(device_t bus, device_t child, int type,
 				   int *rid, u_long start, u_long end,
@@ -374,6 +377,8 @@ int	bus_alloc_resources(device_t dev, st
 void	bus_release_resources(device_t dev, const struct resource_spec *rs,
 			      struct resource **res);
 
+int	bus_adjust_resource(device_t child, int type, struct resource *r,
+			    u_long start, u_long end);
 struct	resource *bus_alloc_resource(device_t dev, int type, int *rid,
 				     u_long start, u_long end, u_long count,
 				     u_int flags);

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 22:40:12 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 13DB5106564A;
	Fri, 29 Apr 2011 22:40:12 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E819F8FC0A;
	Fri, 29 Apr 2011 22:40:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TMeBcS018589;
	Fri, 29 Apr 2011 22:40:11 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TMeBaK018586;
	Fri, 29 Apr 2011 22:40:11 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104292240.p3TMeBaK018586@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Fri, 29 Apr 2011 22:40:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221232 - head/sbin/mdconfig
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 22:40:12 -0000

Author: des
Date: Fri Apr 29 22:40:11 2011
New Revision: 221232
URL: http://svn.freebsd.org/changeset/base/221232

Log:
  Somewhere around the 473rd time I mistyped "mdconfig file" instead of
  "mdconfig -f file", I decided that it would be easier to make mdconfig
  DWIM than to teach my fingers to type the correct command line.
  
  MFC after:	3 weeks

Modified:
  head/sbin/mdconfig/mdconfig.8
  head/sbin/mdconfig/mdconfig.c

Modified: head/sbin/mdconfig/mdconfig.8
==============================================================================
--- head/sbin/mdconfig/mdconfig.8	Fri Apr 29 21:36:45 2011	(r221231)
+++ head/sbin/mdconfig/mdconfig.8	Fri Apr 29 22:40:11 2011	(r221232)
@@ -68,6 +68,8 @@
 .Op Fl n
 .Op Fl v
 .Op Fl u Ar unit
+.Nm
+.Ar file
 .Sh DESCRIPTION
 The
 .Nm
@@ -185,6 +187,15 @@ Request a specific unit number for the
 .Xr md 4
 device instead of automatic allocation.
 .El
+.Pp
+The last form,
+.Nm
+.Ar file ,
+is provided for convenience as an abbreviation of
+.Nm
+.Fl a
+.Fl t Ar vnode
+.Fl f Ar file .
 .Sh EXAMPLES
 To create a 4 megabyte
 .Xr malloc 9

Modified: head/sbin/mdconfig/mdconfig.c
==============================================================================
--- head/sbin/mdconfig/mdconfig.c	Fri Apr 29 21:36:45 2011	(r221231)
+++ head/sbin/mdconfig/mdconfig.c	Fri Apr 29 22:40:11 2011	(r221232)
@@ -38,6 +38,7 @@ static enum {UNSET, ATTACH, DETACH, LIST
 static int nflag;
 
 static void usage(void);
+static void md_set_file(const char *);
 static int md_find(char *, const char *);
 static int md_query(char *name);
 static int md_list(char *units, int opt);
@@ -59,7 +60,8 @@ usage(void)
 "                [-s size] [-S sectorsize] [-u unit]\n"
 "                [-x sectors/track] [-y heads/cylinder]\n"
 "       mdconfig -d -u unit [-o [no]force]\n"
-"       mdconfig -l [-v] [-n] [-u unit]\n");
+"       mdconfig -l [-v] [-n] [-u unit]\n"
+"       mdconfig file\n");
 	fprintf(stderr, "\t\ttype = {malloc, preload, vnode, swap}\n");
 	fprintf(stderr, "\t\toption = {cluster, compress, reserve}\n");
 	fprintf(stderr, "\t\tsize = %%d (512 byte blocks), %%db (B),\n");
@@ -82,10 +84,7 @@ main(int argc, char **argv)
 		err(1, "could not allocate memory");
 	vflag = 0;
 	bzero(mdio.md_file, PATH_MAX);
-	for (;;) {
-		ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:vx:y:");
-		if (ch == -1)
-			break;
+	while ((ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:vx:y:")) != -1) {
 		switch (ch) {
 		case 'a':
 			if (cmdline != 0)
@@ -143,21 +142,7 @@ main(int argc, char **argv)
 			}
 			if (cmdline != 2)
 				usage();
-			if (realpath(optarg, mdio.md_file) == NULL) {
-				err(1, "could not find full path for %s",
-				    optarg);
-			}
-			fd = open(mdio.md_file, O_RDONLY);
-			if (fd < 0)
-				err(1, "could not open %s", optarg);
-			else if (mdio.md_mediasize == 0) {
-				struct stat sb;
-
-				if (fstat(fd, &sb) == -1)
-					err(1, "could not stat %s", optarg);
-				mdio.md_mediasize = sb.st_size;
-			}
-			close(fd);
+			md_set_file(optarg);
 			break;
 		case 'o':
 			if (action == DETACH) {
@@ -267,6 +252,19 @@ main(int argc, char **argv)
 			usage();
 		}
 	}
+
+	argc -= optind;
+	argv += optind;
+	if (action == UNSET) {
+		if (argc != 1)
+			usage();
+		action = ATTACH;
+		mdio.md_type = MD_VNODE;
+		mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS;
+		cmdline = 2;
+		md_set_file(*argv);
+	}
+
 	mdio.md_version = MDIOVERSION;
 
 	if (!kld_isloaded("g_md") && kld_load("geom_md") == -1)
@@ -322,6 +320,26 @@ main(int argc, char **argv)
 	return (0);
 }
 
+static void
+md_set_file(const char *fn)
+{
+	struct stat sb;
+	int fd;
+
+	if (realpath(fn, mdio.md_file) == NULL)
+		err(1, "could not find full path for %s", fn);
+	fd = open(mdio.md_file, O_RDONLY);
+	if (fd < 0)
+		err(1, "could not open %s", fn);
+	if (fstat(fd, &sb) == -1)
+		err(1, "could not stat %s", fn);
+	if (!S_ISREG(sb.st_mode))
+		errx(1, "%s is not a regular file", fn);
+	if (mdio.md_mediasize == 0)
+		mdio.md_mediasize = sb.st_size;
+	close(fd);
+}
+
 /*
  * Lists md(4) disks. Is used also as a query routine, since it handles XML
  * interface. 'units' can be NULL for listing memory disks. It might be

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 23:00:23 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8FEAB106566B;
	Fri, 29 Apr 2011 23:00:23 +0000 (UTC) (envelope-from des@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7BD708FC08;
	Fri, 29 Apr 2011 23:00:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TN0Nlj019293;
	Fri, 29 Apr 2011 23:00:23 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TN0N8N019287;
	Fri, 29 Apr 2011 23:00:23 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201104292300.p3TN0N8N019287@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Fri, 29 Apr 2011 23:00:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221233 - head/sbin/fsck_ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 23:00:23 -0000

Author: des
Date: Fri Apr 29 23:00:23 2011
New Revision: 221233
URL: http://svn.freebsd.org/changeset/base/221233

Log:
  Add an -E option to mirror newfs's.  The idea is that if you have a system
  that was built before ffs grew support for TRIM, your filesystem will have
  plenty of free blocks that the flash chip doesn't know are free, so it
  can't take advantage of them for wear leveling.  Once you've upgraded your
  kernel, you enable TRIM on the filesystem (tunefs -t enable), then run
  fsck_ffs -E on it before mounting it.
  
  I tested this patch by half-filling an mdconfig'ed filesystem image,
  running fsck_ffs -E on it, then verifying that the contents were not
  damaged by comparing them to a pristine copy using rsync's checksum
  functionality.  There is no reliable way to test it on real hardware.
  
  Many thanks to mckusick@, who provided the tricky parts of this patch and
  reviewed the final version.
  
  Reviewed by:	mckusick@
  MFC after:	3 weeks

Modified:
  head/sbin/fsck_ffs/fsck.h
  head/sbin/fsck_ffs/fsck_ffs.8
  head/sbin/fsck_ffs/fsutil.c
  head/sbin/fsck_ffs/main.c
  head/sbin/fsck_ffs/pass5.c

Modified: head/sbin/fsck_ffs/fsck.h
==============================================================================
--- head/sbin/fsck_ffs/fsck.h	Fri Apr 29 22:40:11 2011	(r221232)
+++ head/sbin/fsck_ffs/fsck.h	Fri Apr 29 23:00:23 2011	(r221233)
@@ -274,6 +274,7 @@ char	yflag;			/* assume a yes response *
 int	bkgrdflag;		/* use a snapshot to run on an active system */
 int	bflag;			/* location of alternate super block */
 int	debug;			/* output debugging info */
+int	Eflag;			/* zero out empty data blocks */
 int	inoopt;			/* trim out unused inodes */
 char	ckclean;		/* only do work if not cleanly unmounted */
 int	cvtlevel;		/* convert to newer file system format */
@@ -337,6 +338,7 @@ char	       *blockcheck(char *name);
 int		blread(int fd, char *buf, ufs2_daddr_t blk, long size);
 void		bufinit(void);
 void		blwrite(int fd, char *buf, ufs2_daddr_t blk, long size);
+void		blerase(int fd, ufs2_daddr_t blk, long size);
 void		cacheino(union dinode *dp, ino_t inumber);
 void		catch(int);
 void		catchquit(int);

Modified: head/sbin/fsck_ffs/fsck_ffs.8
==============================================================================
--- head/sbin/fsck_ffs/fsck_ffs.8	Fri Apr 29 22:40:11 2011	(r221232)
+++ head/sbin/fsck_ffs/fsck_ffs.8	Fri Apr 29 23:00:23 2011	(r221233)
@@ -29,7 +29,7 @@
 .\"	@(#)fsck.8	8.4 (Berkeley) 5/9/95
 .\" $FreeBSD$
 .\"
-.Dd January 25, 2009
+.Dd April 27, 2011
 .Dt FSCK_FFS 8
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .Nd file system consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl BFfnpry
+.Op Fl BEFfnpry
 .Op Fl b Ar block
 .Op Fl c Ar level
 .Op Fl m Ar mode
@@ -149,6 +149,24 @@ If unexpected errors are found,
 the file system is marked as needing a foreground check and
 .Nm
 exits without attempting any further cleaning.
+.It Fl E
+Clear unallocated blocks, notifying the underlying device that they
+are not used and that their contents may be discarded.
+This is useful for filesystems which have been mounted on systems
+without TRIM support, or with TRIM support disabled, as well as
+filesystems which have been copied from one device to another.
+.Pp
+See the
+.Fl E
+and
+.Fl t
+flags of
+.Xr newfs 8 ,
+and
+the
+.Fl t
+flag of
+.Xr tunefs 8 .
 .It Fl F
 Determine whether the file system needs to be cleaned immediately
 in foreground, or if its cleaning can be deferred to background.

Modified: head/sbin/fsck_ffs/fsutil.c
==============================================================================
--- head/sbin/fsck_ffs/fsutil.c	Fri Apr 29 22:40:11 2011	(r221232)
+++ head/sbin/fsck_ffs/fsutil.c	Fri Apr 29 23:00:23 2011	(r221233)
@@ -39,9 +39,10 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
-#include 
 
 #include 
 #include 
@@ -421,6 +422,20 @@ blwrite(int fd, char *buf, ufs2_daddr_t 
 	return;
 }
 
+void
+blerase(int fd, ufs2_daddr_t blk, long size)
+{
+	off_t ioarg[2];
+
+	if (fd < 0)
+		return;
+	ioarg[0] = blk * dev_bsize;
+	ioarg[1] = size;
+	ioctl(fd, DIOCGDELETE, ioarg);
+	/* we don't really care if we succeed or not */
+	return;
+}
+
 /*
  * Verify cylinder group's magic number and other parameters.  If the
  * test fails, offer an option to rebuild the whole cylinder group.

Modified: head/sbin/fsck_ffs/main.c
==============================================================================
--- head/sbin/fsck_ffs/main.c	Fri Apr 29 22:40:11 2011	(r221232)
+++ head/sbin/fsck_ffs/main.c	Fri Apr 29 23:00:23 2011	(r221233)
@@ -82,7 +82,7 @@ main(int argc, char *argv[])
 	sync();
 	skipclean = 1;
 	inoopt = 0;
-	while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npry")) != -1) {
+	while ((ch = getopt(argc, argv, "b:Bc:CdEfFm:npry")) != -1) {
 		switch (ch) {
 		case 'b':
 			skipclean = 0;
@@ -106,6 +106,10 @@ main(int argc, char *argv[])
 			debug++;
 			break;
 
+		case 'E':
+			Eflag++;
+			break;
+
 		case 'f':
 			skipclean = 0;
 			break;
@@ -632,7 +636,7 @@ static void
 usage(void)
 {
 	(void) fprintf(stderr,
-	    "usage: %s [-BFprfny] [-b block] [-c level] [-m mode] "
+	    "usage: %s [-BEFprfny] [-b block] [-c level] [-m mode] "
 			"filesystem ...\n",
 	    getprogname());
 	exit(1);

Modified: head/sbin/fsck_ffs/pass5.c
==============================================================================
--- head/sbin/fsck_ffs/pass5.c	Fri Apr 29 22:40:11 2011	(r221232)
+++ head/sbin/fsck_ffs/pass5.c	Fri Apr 29 23:00:23 2011	(r221233)
@@ -51,6 +51,8 @@ __FBSDID("$FreeBSD$");
 
 static void check_maps(u_char *, u_char *, int, ufs2_daddr_t, const char *, int *, int, int);
 
+static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end);
+
 void
 pass5(void)
 {
@@ -58,7 +60,7 @@ pass5(void)
 	int inomapsize, blkmapsize;
 	struct fs *fs = &sblock;
 	struct cg *cg = &cgrp;
-	ufs2_daddr_t d, dbase, dmax;
+	ufs2_daddr_t d, dbase, dmax, start;
 	int excessdirs, rewritecg = 0;
 	struct csum *cs;
 	struct csum_total cstotal;
@@ -242,13 +244,21 @@ pass5(void)
 				setbit(cg_inosused(newcg), i);
 				newcg->cg_cs.cs_nifree--;
 			}
+		start = -1;
 		for (i = 0, d = dbase;
 		     d < dmax;
 		     d += fs->fs_frag, i += fs->fs_frag) {
 			frags = 0;
 			for (j = 0; j < fs->fs_frag; j++) {
-				if (testbmap(d + j))
+				if (testbmap(d + j)) {
+					if (Eflag && start != -1) {
+						clear_blocks(start, d + j - 1);
+						start = -1;
+					}
 					continue;
+				}
+				if (start == -1)
+					start = d + j;
 				setbit(cg_blksfree(newcg), i + j);
 				frags++;
 			}
@@ -263,6 +273,8 @@ pass5(void)
 				ffs_fragacct(fs, blk, newcg->cg_frsum, 1);
 			}
 		}
+		if (Eflag && start != -1)
+			clear_blocks(start, d - 1);
 		if (fs->fs_contigsumsize > 0) {
 			int32_t *sump = cg_clustersum(newcg);
 			u_char *mapp = cg_clustersfree(newcg);
@@ -551,3 +563,12 @@ check_maps(
 		}
 	}
 }
+
+static void clear_blocks(ufs2_daddr_t start, ufs2_daddr_t end)
+{
+
+	if (debug)
+		printf("Zero frags %jd to %jd\n", start, end);
+	blerase(fswritefd, fsbtodb(&sblock, start),
+	    lfragtosize(&sblock, end - start + 1));
+}

From owner-svn-src-head@FreeBSD.ORG  Fri Apr 29 23:13:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD2061065677;
	Fri, 29 Apr 2011 23:13:43 +0000 (UTC)
	(envelope-from kargl@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A8EA08FC17;
	Fri, 29 Apr 2011 23:13:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3TNDhVf019726;
	Fri, 29 Apr 2011 23:13:43 GMT (envelope-from kargl@svn.freebsd.org)
Received: (from kargl@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3TNDhD6019720;
	Fri, 29 Apr 2011 23:13:43 GMT (envelope-from kargl@svn.freebsd.org)
Message-Id: <201104292313.p3TNDhD6019720@svn.freebsd.org>
From: Steve Kargl 
Date: Fri, 29 Apr 2011 23:13:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221234 - in head/lib/msun: ld128 ld80 src
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Fri, 29 Apr 2011 23:13:43 -0000

Author: kargl
Date: Fri Apr 29 23:13:43 2011
New Revision: 221234
URL: http://svn.freebsd.org/changeset/base/221234

Log:
  Improve the accuracy from a max ULP of ~2000 to max ULP < 0.79
  on i386-class hardware for sinl and cosl.  The hand-rolled argument
  reduction have been replaced by e_rem_pio2l() implementations.  To
  preserve history the following commands have been executed:
  
  svn cp src/e_rem_pio2.c ld80/e_rem_pio2l.h
  mv ${HOME}/bde/ld80/e_rem_pio2l.c ld80/e_rem_pio2l.h
  
  svn cp src/e_rem_pio2.c ld128/e_rem_pio2l.h
  mv ${HOME}/bde/ld128/e_rem_pio2l.c ld128/e_rem_pio2l.h
  
  The ld80 version has been tested by bde, das, and kargl over the
  last few years (bde, das) and few months (kargl).  An older ld128
  version was tested by das.  The committed version has only been
  compiled tested via 'make universe'.
  
  Approved by: das (mentor)
  Obtained from: bde

Added:
  head/lib/msun/ld128/e_rem_pio2l.h
     - copied, changed from r221219, head/lib/msun/src/e_rem_pio2.c
  head/lib/msun/ld80/e_rem_pio2l.h
     - copied, changed from r221219, head/lib/msun/src/e_rem_pio2.c
Modified:
  head/lib/msun/src/s_cosl.c
  head/lib/msun/src/s_sinl.c
  head/lib/msun/src/s_tanl.c

Copied and modified: head/lib/msun/ld128/e_rem_pio2l.h (from r221219, head/lib/msun/src/e_rem_pio2.c)
==============================================================================
--- head/lib/msun/src/e_rem_pio2.c	Fri Apr 29 18:49:36 2011	(r221219, copy source)
+++ head/lib/msun/ld128/e_rem_pio2l.h	Fri Apr 29 23:13:43 2011	(r221234)
@@ -1,8 +1,8 @@
-
-/* @(#)e_rem_pio2.c 1.4 95/01/18 */
+/* From: @(#)e_rem_pio2.c 1.4 95/01/18 */
 /*
  * ====================================================
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
  *
  * Developed at SunSoft, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
@@ -16,7 +16,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-/* __ieee754_rem_pio2(x,y)
+/* ld128 version of __ieee754_rem_pio2l(x,y)
  * 
  * return the remainder of x rem pi/2 in y[0]+y[1] 
  * use __kernel_rem_pio2()
@@ -26,132 +26,85 @@ __FBSDID("$FreeBSD$");
 
 #include "math.h"
 #include "math_private.h"
+#include "fpmath.h"
+
+#define	BIAS	(LDBL_MAX_EXP - 1)
 
 /*
- * invpio2:  53 bits of 2/pi
- * pio2_1:   first  33 bit of pi/2
+ * XXX need to verify that nonzero integer multiples of pi/2 within the
+ * range get no closer to a long double than 2**-140, or that
+ * ilogb(x) + ilogb(min_delta) < 45 - -140.
+ */
+/*
+ * invpio2:  113 bits of 2/pi
+ * pio2_1:   first  68 bits of pi/2
  * pio2_1t:  pi/2 - pio2_1
- * pio2_2:   second 33 bit of pi/2
+ * pio2_2:   second 68 bits of pi/2
  * pio2_2t:  pi/2 - (pio2_1+pio2_2)
- * pio2_3:   third  33 bit of pi/2
+ * pio2_3:   third  68 bits of pi/2
  * pio2_3t:  pi/2 - (pio2_1+pio2_2+pio2_3)
  */
 
 static const double
 zero =  0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
-two24 =  1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
-invpio2 =  6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
-pio2_1  =  1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */
-pio2_1t =  6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */
-pio2_2  =  6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */
-pio2_2t =  2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */
-pio2_3  =  2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
-pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
+two24 =  1.67772160000000000000e+07; /* 0x41700000, 0x00000000 */
 
-#ifndef INLINE_REM_PIO2
-extern
+static const long double
+invpio2 =  6.3661977236758134307553505349005747e-01L,	/*  0x145f306dc9c882a53f84eafa3ea6a.0p-113 */
+pio2_1  =  1.5707963267948966192292994253909555e+00L,	/*  0x1921fb54442d18469800000000000.0p-112 */
+pio2_1t =  2.0222662487959507323996846200947577e-21L,	/*  0x13198a2e03707344a4093822299f3.0p-181 */
+pio2_2  =  2.0222662487959507323994779168837751e-21L,	/*  0x13198a2e03707344a400000000000.0p-181 */
+pio2_2t =  2.0670321098263988236496903051604844e-43L,	/*  0x127044533e63a0105df531d89cd91.0p-254 */
+pio2_3  =  2.0670321098263988236499468110329591e-43L,	/*  0x127044533e63a0105e00000000000.0p-254 */
+pio2_3t = -2.5650587247459238361625433492959285e-65L;	/* -0x159c4ec64ddaeb5f78671cbfb2210.0p-327 */
+
+#ifdef INLINE_REM_PIO2L
+static inline __always_inline
 #endif
-__inline int
-__ieee754_rem_pio2(double x, double *y)
+int
+__ieee754_rem_pio2l(long double x, long double *y)
 {
-	double z,w,t,r,fn;
-	double tx[3],ty[2];
-	int32_t e0,i,j,nx,n,ix,hx;
-	u_int32_t low;
-
-	GET_HIGH_WORD(hx,x);		/* high word of x */
-	ix = hx&0x7fffffff;
-#if 0 /* Must be handled in caller. */
-	if(ix<=0x3fe921fb)   /* |x| ~<= pi/4 , no need for reduction */
-	    {y[0] = x; y[1] = 0; return 0;}
-#endif
-	if (ix <= 0x400f6a7a) {		/* |x| ~<= 5pi/4 */
-	    if ((ix & 0xfffff) == 0x921fb)  /* |x| ~= pi/2 or 2pi/2 */
-		goto medium;		/* cancellation -- use medium case */
-	    if (ix <= 0x4002d97c) {	/* |x| ~<= 3pi/4 */
-		if (hx > 0) {
-		    z = x - pio2_1;	/* one round good to 85 bits */
-		    y[0] = z - pio2_1t;
-		    y[1] = (z-y[0])-pio2_1t;
-		    return 1;
-		} else {
-		    z = x + pio2_1;
-		    y[0] = z + pio2_1t;
-		    y[1] = (z-y[0])+pio2_1t;
-		    return -1;
-		}
-	    } else {
-		if (hx > 0) {
-		    z = x - 2*pio2_1;
-		    y[0] = z - 2*pio2_1t;
-		    y[1] = (z-y[0])-2*pio2_1t;
-		    return 2;
-		} else {
-		    z = x + 2*pio2_1;
-		    y[0] = z + 2*pio2_1t;
-		    y[1] = (z-y[0])+2*pio2_1t;
-		    return -2;
-		}
-	    }
-	}
-	if (ix <= 0x401c463b) {		/* |x| ~<= 9pi/4 */
-	    if (ix <= 0x4015fdbc) {	/* |x| ~<= 7pi/4 */
-		if (ix == 0x4012d97c)	/* |x| ~= 3pi/2 */
-		    goto medium;
-		if (hx > 0) {
-		    z = x - 3*pio2_1;
-		    y[0] = z - 3*pio2_1t;
-		    y[1] = (z-y[0])-3*pio2_1t;
-		    return 3;
-		} else {
-		    z = x + 3*pio2_1;
-		    y[0] = z + 3*pio2_1t;
-		    y[1] = (z-y[0])+3*pio2_1t;
-		    return -3;
-		}
-	    } else {
-		if (ix == 0x401921fb)	/* |x| ~= 4pi/2 */
-		    goto medium;
-		if (hx > 0) {
-		    z = x - 4*pio2_1;
-		    y[0] = z - 4*pio2_1t;
-		    y[1] = (z-y[0])-4*pio2_1t;
-		    return 4;
-		} else {
-		    z = x + 4*pio2_1;
-		    y[0] = z + 4*pio2_1t;
-		    y[1] = (z-y[0])+4*pio2_1t;
-		    return -4;
-		}
-	    }
-	}
-	if(ix<0x413921fb) {	/* |x| ~< 2^20*(pi/2), medium size */
-medium:
+	union IEEEl2bits u,u1;
+	long double z,w,t,r,fn;
+	double tx[5],ty[3];
+	int64_t n;
+	int e0,ex,i,j,nx;
+	int16_t expsign;
+
+	u.e = x;
+	expsign = u.xbits.expsign;
+	ex = expsign & 0x7fff;
+	if (ex < BIAS + 45 || ex == BIAS + 45 &&
+	    u.bits.manh < 0x921fb54442d1LL) {
+	    /* |x| ~< 2^45*(pi/2), medium size */
 	    /* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	    STRICT_ASSIGN(double,fn,x*invpio2+0x1.8p52);
-	    fn = fn-0x1.8p52;
-#ifdef HAVE_EFFICIENT_IRINT
-	    n  = irint(fn);
+	    fn = x*invpio2+0x1.8p112;
+	    fn = fn-0x1.8p112;
+#ifdef HAVE_EFFICIENT_I64RINT
+	    n  = i64rint(fn);
 #else
-	    n  = (int32_t)fn;
+	    n  = fn;
 #endif
 	    r  = x-fn*pio2_1;
-	    w  = fn*pio2_1t;	/* 1st round good to 85 bit */
+	    w  = fn*pio2_1t;	/* 1st round good to 180 bit */
 	    {
-	        u_int32_t high;
-	        j  = ix>>20;
+		union IEEEl2bits u2;
+	        int ex1;
+	        j  = ex;
 	        y[0] = r-w; 
-		GET_HIGH_WORD(high,y[0]);
-	        i = j-((high>>20)&0x7ff);
-	        if(i>16) {  /* 2nd iteration needed, good to 118 */
+		u2.e = y[0];
+		ex1 = u2.xbits.expsign & 0x7fff;
+	        i = j-ex1;
+	        if(i>51) {  /* 2nd iteration needed, good to 248 */
 		    t  = r;
 		    w  = fn*pio2_2;	
 		    r  = t-w;
 		    w  = fn*pio2_2t-((t-r)-w);	
 		    y[0] = r-w;
-		    GET_HIGH_WORD(high,y[0]);
-		    i = j-((high>>20)&0x7ff);
-		    if(i>49)  {	/* 3rd iteration need, 151 bits acc */
+		    u2.e = y[0];
+		    ex1 = u2.xbits.expsign & 0x7fff;
+		    i = j-ex1;
+		    if(i>119) {	/* 3rd iteration need, 316 bits acc */
 		    	t  = r;	/* will cover all possible cases */
 		    	w  = fn*pio2_3;	
 		    	r  = t-w;
@@ -166,22 +119,25 @@ medium:
     /* 
      * all other (large) arguments
      */
-	if(ix>=0x7ff00000) {		/* x is inf or NaN */
+	if(ex==0x7fff) {		/* x is inf or NaN */
 	    y[0]=y[1]=x-x; return 0;
 	}
     /* set z = scalbn(|x|,ilogb(x)-23) */
-	GET_LOW_WORD(low,x);
-	SET_LOW_WORD(z,low);
-	e0 	= (ix>>20)-1046;	/* e0 = ilogb(z)-23; */
-	SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20)));
-	for(i=0;i<2;i++) {
+	u1.e = x;
+	e0 = ex - BIAS - 23;		/* e0 = ilogb(|x|)-23; */
+	u1.xbits.expsign = ex - e0;
+	z = u1.e;
+	for(i=0;i<4;i++) {
 		tx[i] = (double)((int32_t)(z));
 		z     = (z-tx[i])*two24;
 	}
-	tx[2] = z;
-	nx = 3;
+	tx[4] = z;
+	nx = 5;
 	while(tx[nx-1]==zero) nx--;	/* skip zero term */
-	n  =  __kernel_rem_pio2(tx,ty,e0,nx,1);
-	if(hx<0) {y[0] = -ty[0]; y[1] = -ty[1]; return -n;}
-	y[0] = ty[0]; y[1] = ty[1]; return n;
+	n  =  __kernel_rem_pio2(tx,ty,e0,nx,3);
+	t = (long double)ty[2] + ty[1];
+	r = t + ty[0];
+	w = ty[0] - (r - t);
+	if(expsign<0) {y[0] = -r; y[1] = -w; return -n;}
+	y[0] = r; y[1] = w; return n;
 }

Copied and modified: head/lib/msun/ld80/e_rem_pio2l.h (from r221219, head/lib/msun/src/e_rem_pio2.c)
==============================================================================
--- head/lib/msun/src/e_rem_pio2.c	Fri Apr 29 18:49:36 2011	(r221219, copy source)
+++ head/lib/msun/ld80/e_rem_pio2l.h	Fri Apr 29 23:13:43 2011	(r221234)
@@ -1,8 +1,8 @@
-
-/* @(#)e_rem_pio2.c 1.4 95/01/18 */
+/* From: @(#)e_rem_pio2.c 1.4 95/01/18 */
 /*
  * ====================================================
  * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2008 Steven G. Kargl, David Schultz, Bruce D. Evans.
  *
  * Developed at SunSoft, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
@@ -16,7 +16,7 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-/* __ieee754_rem_pio2(x,y)
+/* ld80 version of __ieee754_rem_pio2l(x,y)
  * 
  * return the remainder of x rem pi/2 in y[0]+y[1] 
  * use __kernel_rem_pio2()
@@ -26,132 +26,95 @@ __FBSDID("$FreeBSD$");
 
 #include "math.h"
 #include "math_private.h"
+#include "fpmath.h"
+
+#define	BIAS	(LDBL_MAX_EXP - 1)
 
 /*
- * invpio2:  53 bits of 2/pi
- * pio2_1:   first  33 bit of pi/2
+ * invpio2:  64 bits of 2/pi
+ * pio2_1:   first  39 bits of pi/2
  * pio2_1t:  pi/2 - pio2_1
- * pio2_2:   second 33 bit of pi/2
+ * pio2_2:   second 39 bits of pi/2
  * pio2_2t:  pi/2 - (pio2_1+pio2_2)
- * pio2_3:   third  33 bit of pi/2
+ * pio2_3:   third  39 bits of pi/2
  * pio2_3t:  pi/2 - (pio2_1+pio2_2+pio2_3)
  */
 
 static const double
 zero =  0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
 two24 =  1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
-invpio2 =  6.36619772367581382433e-01, /* 0x3FE45F30, 0x6DC9C883 */
-pio2_1  =  1.57079632673412561417e+00, /* 0x3FF921FB, 0x54400000 */
-pio2_1t =  6.07710050650619224932e-11, /* 0x3DD0B461, 0x1A626331 */
-pio2_2  =  6.07710050630396597660e-11, /* 0x3DD0B461, 0x1A600000 */
-pio2_2t =  2.02226624879595063154e-21, /* 0x3BA3198A, 0x2E037073 */
-pio2_3  =  2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
-pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
+pio2_1  =  1.57079632679597125389e+00,	/* 0x3FF921FB, 0x54444000 */
+pio2_2  = -1.07463465549783099519e-12,	/* -0x12e7b967674000.0p-92 */
+pio2_3  =  6.36831716351370313614e-25;	/*  0x18a2e037074000.0p-133 */
+
+#if defined(__amd64__) || defined(__i386__)
+/* Long double constants are slow on these arches, and broken on i386. */
+static const volatile double
+invpio2hi =  6.3661977236758138e-01,	/*  0x145f306dc9c883.0p-53 */
+invpio2lo = -3.9356538861223811e-17,	/* -0x16b00000000000.0p-107 */
+pio2_1thi = -1.0746346554971943e-12,	/* -0x12e7b9676733af.0p-92 */
+pio2_1tlo =  8.8451028997905949e-29,	/*  0x1c080000000000.0p-146 */
+pio2_2thi =  6.3683171635109499e-25,	/*  0x18a2e03707344a.0p-133 */
+pio2_2tlo =  2.3183081793789774e-41,	/*  0x10280000000000.0p-187 */
+pio2_3thi = -2.7529965190440717e-37,	/* -0x176b7ed8fbbacc.0p-174 */
+pio2_3tlo = -4.2006647512740502e-54;	/* -0x19c00000000000.0p-230 */
+#define	invpio2	((long double)invpio2hi + invpio2lo)
+#define	pio2_1t	((long double)pio2_1thi + pio2_1tlo)
+#define	pio2_2t	((long double)pio2_2thi + pio2_2tlo)
+#define	pio2_3t	((long double)pio2_3thi + pio2_3tlo)
+#else
+static const long double
+invpio2 =  6.36619772367581343076e-01L,	/*  0xa2f9836e4e44152a.0p-64 */
+pio2_1t = -1.07463465549719416346e-12L,	/* -0x973dcb3b399d747f.0p-103 */
+pio2_2t =  6.36831716351095013979e-25L,	/*  0xc51701b839a25205.0p-144 */
+pio2_3t = -2.75299651904407171810e-37L;	/* -0xbb5bf6c7ddd660ce.0p-185 */
+#endif
 
-#ifndef INLINE_REM_PIO2
-extern
+#ifdef INLINE_REM_PIO2L
+static inline __always_inline
 #endif
-__inline int
-__ieee754_rem_pio2(double x, double *y)
+int
+__ieee754_rem_pio2l(long double x, long double *y)
 {
-	double z,w,t,r,fn;
+	union IEEEl2bits u,u1;
+	long double z,w,t,r,fn;
 	double tx[3],ty[2];
-	int32_t e0,i,j,nx,n,ix,hx;
-	u_int32_t low;
+	int e0,ex,i,j,nx,n;
+	int16_t expsign;
 
-	GET_HIGH_WORD(hx,x);		/* high word of x */
-	ix = hx&0x7fffffff;
-#if 0 /* Must be handled in caller. */
-	if(ix<=0x3fe921fb)   /* |x| ~<= pi/4 , no need for reduction */
-	    {y[0] = x; y[1] = 0; return 0;}
-#endif
-	if (ix <= 0x400f6a7a) {		/* |x| ~<= 5pi/4 */
-	    if ((ix & 0xfffff) == 0x921fb)  /* |x| ~= pi/2 or 2pi/2 */
-		goto medium;		/* cancellation -- use medium case */
-	    if (ix <= 0x4002d97c) {	/* |x| ~<= 3pi/4 */
-		if (hx > 0) {
-		    z = x - pio2_1;	/* one round good to 85 bits */
-		    y[0] = z - pio2_1t;
-		    y[1] = (z-y[0])-pio2_1t;
-		    return 1;
-		} else {
-		    z = x + pio2_1;
-		    y[0] = z + pio2_1t;
-		    y[1] = (z-y[0])+pio2_1t;
-		    return -1;
-		}
-	    } else {
-		if (hx > 0) {
-		    z = x - 2*pio2_1;
-		    y[0] = z - 2*pio2_1t;
-		    y[1] = (z-y[0])-2*pio2_1t;
-		    return 2;
-		} else {
-		    z = x + 2*pio2_1;
-		    y[0] = z + 2*pio2_1t;
-		    y[1] = (z-y[0])+2*pio2_1t;
-		    return -2;
-		}
-	    }
-	}
-	if (ix <= 0x401c463b) {		/* |x| ~<= 9pi/4 */
-	    if (ix <= 0x4015fdbc) {	/* |x| ~<= 7pi/4 */
-		if (ix == 0x4012d97c)	/* |x| ~= 3pi/2 */
-		    goto medium;
-		if (hx > 0) {
-		    z = x - 3*pio2_1;
-		    y[0] = z - 3*pio2_1t;
-		    y[1] = (z-y[0])-3*pio2_1t;
-		    return 3;
-		} else {
-		    z = x + 3*pio2_1;
-		    y[0] = z + 3*pio2_1t;
-		    y[1] = (z-y[0])+3*pio2_1t;
-		    return -3;
-		}
-	    } else {
-		if (ix == 0x401921fb)	/* |x| ~= 4pi/2 */
-		    goto medium;
-		if (hx > 0) {
-		    z = x - 4*pio2_1;
-		    y[0] = z - 4*pio2_1t;
-		    y[1] = (z-y[0])-4*pio2_1t;
-		    return 4;
-		} else {
-		    z = x + 4*pio2_1;
-		    y[0] = z + 4*pio2_1t;
-		    y[1] = (z-y[0])+4*pio2_1t;
-		    return -4;
-		}
-	    }
-	}
-	if(ix<0x413921fb) {	/* |x| ~< 2^20*(pi/2), medium size */
-medium:
+	u.e = x;
+	expsign = u.xbits.expsign;
+	ex = expsign & 0x7fff;
+	if (ex < BIAS + 25 || ex == BIAS + 25 && u.bits.manh < 0xc90fdaa2) {
+	    /* |x| ~< 2^25*(pi/2), medium size */
 	    /* Use a specialized rint() to get fn.  Assume round-to-nearest. */
-	    STRICT_ASSIGN(double,fn,x*invpio2+0x1.8p52);
-	    fn = fn-0x1.8p52;
+	    fn = x*invpio2+0x1.8p63;
+	    fn = fn-0x1.8p63;
 #ifdef HAVE_EFFICIENT_IRINT
 	    n  = irint(fn);
 #else
-	    n  = (int32_t)fn;
+	    n  = fn;
 #endif
 	    r  = x-fn*pio2_1;
-	    w  = fn*pio2_1t;	/* 1st round good to 85 bit */
+	    w  = fn*pio2_1t;	/* 1st round good to 102 bit */
 	    {
-	        u_int32_t high;
-	        j  = ix>>20;
+		union IEEEl2bits u2;
+	        int ex1;
+	        j  = ex;
 	        y[0] = r-w; 
-		GET_HIGH_WORD(high,y[0]);
-	        i = j-((high>>20)&0x7ff);
-	        if(i>16) {  /* 2nd iteration needed, good to 118 */
+		u2.e = y[0];
+		ex1 = u2.xbits.expsign & 0x7fff;
+	        i = j-ex1;
+	        if(i>22) {  /* 2nd iteration needed, good to 141 */
 		    t  = r;
 		    w  = fn*pio2_2;	
 		    r  = t-w;
 		    w  = fn*pio2_2t-((t-r)-w);	
 		    y[0] = r-w;
-		    GET_HIGH_WORD(high,y[0]);
-		    i = j-((high>>20)&0x7ff);
-		    if(i>49)  {	/* 3rd iteration need, 151 bits acc */
+		    u2.e = y[0];
+		    ex1 = u2.xbits.expsign & 0x7fff;
+		    i = j-ex1;
+		    if(i>61) {	/* 3rd iteration need, 180 bits acc */
 		    	t  = r;	/* will cover all possible cases */
 		    	w  = fn*pio2_3;	
 		    	r  = t-w;
@@ -166,14 +129,14 @@ medium:
     /* 
      * all other (large) arguments
      */
-	if(ix>=0x7ff00000) {		/* x is inf or NaN */
+	if(ex==0x7fff) {		/* x is inf or NaN */
 	    y[0]=y[1]=x-x; return 0;
 	}
     /* set z = scalbn(|x|,ilogb(x)-23) */
-	GET_LOW_WORD(low,x);
-	SET_LOW_WORD(z,low);
-	e0 	= (ix>>20)-1046;	/* e0 = ilogb(z)-23; */
-	SET_HIGH_WORD(z, ix - ((int32_t)(e0<<20)));
+	u1.e = x;
+	e0 = ex - BIAS - 23;		/* e0 = ilogb(|x|)-23; */
+	u1.xbits.expsign = ex - e0;
+	z = u1.e;
 	for(i=0;i<2;i++) {
 		tx[i] = (double)((int32_t)(z));
 		z     = (z-tx[i])*two24;
@@ -181,7 +144,9 @@ medium:
 	tx[2] = z;
 	nx = 3;
 	while(tx[nx-1]==zero) nx--;	/* skip zero term */
-	n  =  __kernel_rem_pio2(tx,ty,e0,nx,1);
-	if(hx<0) {y[0] = -ty[0]; y[1] = -ty[1]; return -n;}
-	y[0] = ty[0]; y[1] = ty[1]; return n;
+	n  =  __kernel_rem_pio2(tx,ty,e0,nx,2);
+	r = (long double)ty[0] + ty[1];
+	w = ty[1] - (r - ty[0]);
+	if(expsign<0) {y[0] = -r; y[1] = -w; return -n;}
+	y[0] = r; y[1] = w; return n;
 }

Modified: head/lib/msun/src/s_cosl.c
==============================================================================
--- head/lib/msun/src/s_cosl.c	Fri Apr 29 23:00:23 2011	(r221233)
+++ head/lib/msun/src/s_cosl.c	Fri Apr 29 23:13:43 2011	(r221234)
@@ -28,7 +28,6 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * Compute cos(x) for x where x is reduced to y = x - k * pi / 2.
  * Limited testing on pseudorandom numbers drawn within [-2e8:4e8] shows
  * an accuracy of <= 0.7412 ULP.
  */
@@ -36,27 +35,22 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include "math.h"
+#define INLINE_REM_PIO2L
 #include "math_private.h"
-#include "fpmath.h"
-
 #if LDBL_MANT_DIG == 64
-#define	NX	3
-#define	PREC	2
+#include "../ld80/e_rem_pio2l.h"
 #elif LDBL_MANT_DIG == 113
-#define	NX	5
-#define	PREC	3
+#include "../ld128/e_rem_pio2l.h"
 #else
 #error "Unsupported long double format"
 #endif
 
-static const long double two24 = 1.67772160000000000000e+07L;
-
 long double
 cosl(long double x)
 {
 	union IEEEl2bits z;
-	int i, e0;
-	double xd[NX], yd[PREC];
+	int e0;
+	long double y[2];
 	long double hi, lo;
 
 	z.e = x;
@@ -74,26 +68,9 @@ cosl(long double x)
 	if (z.e < M_PI_4)
 		return (__kernel_cosl(z.e, 0));
 
-	/* Split z.e into a 24-bit representation. */
-	e0 = ilogbl(z.e) - 23;
-	z.e = scalbnl(z.e, -e0);
-	for (i = 0; i < NX; i++) {
-		xd[i] = (double)((int32_t)z.e);
-		z.e = (z.e - xd[i]) * two24;
-	}
-	
-	/* yd contains the pieces of xd rem pi/2 such that |yd| < pi/4. */
-	e0 = __kernel_rem_pio2(xd, yd, e0, NX, PREC);
-
-#if PREC == 2
-	hi = (long double)yd[0] + yd[1];
-	lo = yd[1] - (hi - yd[0]);
-#else /* PREC == 3 */
-	long double t;
-	t = (long double)yd[2] + yd[1];
-	hi = t + yd[0];
-	lo = yd[0] - (hi - t);
-#endif
+	e0 = __ieee754_rem_pio2l(x, y);
+	hi = y[0];
+	lo = y[1];
 
 	switch (e0 & 3) {
 	case 0:

Modified: head/lib/msun/src/s_sinl.c
==============================================================================
--- head/lib/msun/src/s_sinl.c	Fri Apr 29 23:00:23 2011	(r221233)
+++ head/lib/msun/src/s_sinl.c	Fri Apr 29 23:13:43 2011	(r221234)
@@ -27,34 +27,25 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-/*
- * Compute sin(x) for x where x is reduced to y = x - k * pi / 2.
- */
-
 #include 
 
 #include "math.h"
+#define INLINE_REM_PIO2L
 #include "math_private.h"
-#include "fpmath.h"
-
 #if LDBL_MANT_DIG == 64
-#define	NX	3
-#define	PREC	2
+#include "../ld80/e_rem_pio2l.h"
 #elif LDBL_MANT_DIG == 113
-#define	NX	5
-#define	PREC	3
+#include "../ld128/e_rem_pio2l.h"
 #else
 #error "Unsupported long double format"
 #endif
 
-static const long double two24 = 1.67772160000000000000e+07L;
-
 long double
 sinl(long double x)
 {
 	union IEEEl2bits z;
-	int i, e0, s;
-	double xd[NX], yd[PREC];
+	int e0, s;
+	long double y[2];
 	long double hi, lo;
 
 	z.e = x;
@@ -75,26 +66,9 @@ sinl(long double x)
 		return  (s ? -hi : hi);
 	}
 
-	/* Split z.e into a 24-bit representation. */
-	e0 = ilogbl(z.e) - 23;
-	z.e = scalbnl(z.e, -e0);
-	for (i = 0; i < NX; i++) {
-		xd[i] = (double)((int32_t)z.e);
-		z.e = (z.e - xd[i]) * two24;
-	}
-
-	/* yd contains the pieces of xd rem pi/2 such that |yd| < pi/4. */
-	e0 = __kernel_rem_pio2(xd, yd, e0, NX, PREC);
-
-#if PREC == 2
-	hi = (long double)yd[0] + yd[1];
-	lo = yd[1] - (hi - yd[0]);
-#else /* PREC == 3 */
-	long double t;
-	t = (long double)yd[2] + yd[1];
-	hi = t + yd[0];
-	lo = yd[0] - (hi - t);
-#endif
+	e0 = __ieee754_rem_pio2l(x, y);
+	hi = y[0];
+	lo = y[1];
 
 	switch (e0 & 3) {
 	case 0:
@@ -111,5 +85,5 @@ sinl(long double x)
 	    break;
 	}
 	
-	return (s ? -hi : hi);
+	return (hi);
 }

Modified: head/lib/msun/src/s_tanl.c
==============================================================================
--- head/lib/msun/src/s_tanl.c	Fri Apr 29 23:00:23 2011	(r221233)
+++ head/lib/msun/src/s_tanl.c	Fri Apr 29 23:13:43 2011	(r221234)
@@ -28,7 +28,6 @@
 __FBSDID("$FreeBSD$");
 
 /*
- * Compute tan(x) for x where x is reduced to y = x - k * pi / 2.
  * Limited testing on pseudorandom numbers drawn within [0:4e8] shows
  * an accuracy of <= 1.5 ULP where 247024 values of x out of 40 million
  * possibles resulted in tan(x) that exceeded 0.5 ULP (ie., 0.6%).
@@ -37,27 +36,22 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include "math.h"
+#define INLINE_REM_PIO2L
 #include "math_private.h"
-#include "fpmath.h"
-
 #if LDBL_MANT_DIG == 64
-#define	NX	3
-#define	PREC	2
+#include "../ld80/e_rem_pio2l.h"
 #elif LDBL_MANT_DIG == 113
-#define	NX	5
-#define	PREC	3
+#include "../ld128/e_rem_pio2l.h"
 #else
 #error "Unsupported long double format"
 #endif
 
-static const long double two24 = 1.67772160000000000000e+07L;
-
 long double
 tanl(long double x)
 {
 	union IEEEl2bits z;
-	int i, e0, s;
-	double xd[NX], yd[PREC];
+	int e0, s;
+	long double y[2];
 	long double hi, lo;
 
 	z.e = x;
@@ -78,26 +72,9 @@ tanl(long double x)
 		return (s ? -hi : hi);
 	}
 
-	/* Split z.e into a 24-bit representation. */
-	e0 = ilogbl(z.e) - 23;
-	z.e = scalbnl(z.e, -e0);
-	for (i = 0; i < NX; i++) {
-		xd[i] = (double)((int32_t)z.e);
-		z.e = (z.e - xd[i]) * two24;
-	}
-	
-	/* yd contains the pieces of xd rem pi/2 such that |yd| < pi/4. */
-	e0 = __kernel_rem_pio2(xd, yd, e0, NX, PREC);
-
-#if PREC == 2
-	hi = (long double)yd[0] + yd[1];
-	lo = yd[1] - (hi - yd[0]);
-#else /* PREC == 3 */
-	long double t;
-	t = (long double)yd[2] + yd[1];
-	hi = t + yd[0];
-	lo = yd[0] - (hi - t);
-#endif
+	e0 = __ieee754_rem_pio2l(x, y);
+	hi = y[0];
+	lo = y[1];
 
 	switch (e0 & 3) {
 	case 0:
@@ -110,5 +87,5 @@ tanl(long double x)
 	    break;
 	}
 
-	return (s ? -hi : hi);
+	return (hi);
 }

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 01:34:17 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DA076106564A;
	Sat, 30 Apr 2011 01:34:17 +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 95CFC8FC12;
	Sat, 30 Apr 2011 01:34:17 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 7C7881FFC5C;
	Sat, 30 Apr 2011 01:16:18 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 3005284571; Sat, 30 Apr 2011 03:16:18 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Rick Macklem 
References: <201104271751.p3RHpp6H081910@svn.freebsd.org>
Date: Sat, 30 Apr 2011 03:16:18 +0200
In-Reply-To: <201104271751.p3RHpp6H081910@svn.freebsd.org> (Rick Macklem's
	message of "Wed, 27 Apr 2011 17:51:51 +0000 (UTC)")
Message-ID: <86y62sfsil.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221124 - in head: . sbin/mount sbin/mount_nfs
	sys/amd64/conf sys/fs/nfsclient sys/i386/conf sys/ia64/conf
	sys/nfsclient sys/pc98/conf sys/powerpc/conf sys/sparc64/conf
	sys/sun4v/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 01:34:17 -0000

Rick Macklem  writes:
> Log:
>   This patch changes head so that the default NFS client is now the new
>   NFS client (which I guess is no longer experimental). The fstype "newnf=
s"
>   is now "nfs" and the regular/old NFS client is now fstype "oldnfs".

Are you going to rename the sysctls as well?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 02:31:57 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 093E1106564A;
	Sat, 30 Apr 2011 02:31:57 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id ECF858FC08;
	Sat, 30 Apr 2011 02:31:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3U2VuAF025722;
	Sat, 30 Apr 2011 02:31:56 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3U2Vucq025720;
	Sat, 30 Apr 2011 02:31:56 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104300231.p3U2Vucq025720@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 02:31:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221240 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 02:31:57 -0000

Author: adrian
Date: Sat Apr 30 02:31:56 2011
New Revision: 221240
URL: http://svn.freebsd.org/changeset/base/221240

Log:
  Add a missing DDR FIFO method for the ar71xx.

Modified:
  head/sys/mips/atheros/ar71xx_chip.c

Modified: head/sys/mips/atheros/ar71xx_chip.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_chip.c	Sat Apr 30 01:49:36 2011	(r221239)
+++ head/sys/mips/atheros/ar71xx_chip.c	Sat Apr 30 02:31:56 2011	(r221240)
@@ -199,6 +199,12 @@ ar71xx_chip_ddr_flush_ge1(void)
 	ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE1);
 }
 
+static void
+ar71xx_chip_ddr_flush_ip2(void)
+{
+	ar71xx_ddr_flush(AR71XX_WB_FLUSH_PCI);
+}
+
 static uint32_t
 ar71xx_chip_get_eth_pll(unsigned int mac, int speed)
 {
@@ -235,6 +241,6 @@ struct ar71xx_cpu_def ar71xx_chip_def = 
 	&ar71xx_chip_ddr_flush_ge0,
 	&ar71xx_chip_ddr_flush_ge1,
 	&ar71xx_chip_get_eth_pll,
-	NULL,
+	&ar71xx_chip_ddr_flush_ip2,
 	&ar71xx_chip_init_usb_peripheral,
 };

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 07:27:00 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67AB61065670;
	Sat, 30 Apr 2011 07:27:00 +0000 (UTC)
	(envelope-from mavbsd@gmail.com)
Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com
	[209.85.214.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 8FCE88FC0A;
	Sat, 30 Apr 2011 07:26:58 +0000 (UTC)
Received: by bwz12 with SMTP id 12so5128545bwz.13
	for ; Sat, 30 Apr 2011 00:26:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:sender:message-id:date:from:user-agent
	:mime-version:to:cc:subject:references:in-reply-to
	:x-enigmail-version:content-type:content-transfer-encoding;
	bh=CC201cNTqnpXrqNLE+caOxXXTLUFXsuuDHYcHNDIfzQ=;
	b=MKbPaCiJ177Qg3SFM56kcUi/RI0RSoFft0hIus/a04nZAECD9nRRwX+gqLlW9bJnVs
	7dnFZbO/kpTTX776opJbOUpdbX3A9JeGt+u6daDA2m9d8h6OWFccNmoeE+8rIF+hoSLa
	plaPffHgqm7TVoUP3Vopts3IaukoL97RtqAOI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:x-enigmail-version:content-type
	:content-transfer-encoding;
	b=PjqhkoP2Tdb8O+LRrVgTb7KKC5tH6rDX3IGCHT1W1JIktRnO0qAGI/sPHtOh3k9TVm
	OpKcE7nZI2xcaBv7b8oss4ghUZP8M3dn8CSqwfJqVmbQ0i6U1FD/6SeVclO3cxWaP9a/
	iiD4x/rN0x64aN7fQ+18pq8kOxQlzaQLGvwvo=
Received: by 10.204.20.147 with SMTP id f19mr849064bkb.163.1304148418172;
	Sat, 30 Apr 2011 00:26:58 -0700 (PDT)
Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226])
	by mx.google.com with ESMTPS id l1sm2024749bkl.1.2011.04.30.00.26.56
	(version=SSLv3 cipher=OTHER); Sat, 30 Apr 2011 00:26:57 -0700 (PDT)
Sender: Alexander Motin 
Message-ID: <4DBBB9B0.5080307@FreeBSD.org>
Date: Sat, 30 Apr 2011 10:26:40 +0300
From: Alexander Motin 
User-Agent: Thunderbird 2.0.0.23 (X11/20091212)
MIME-Version: 1.0
To: Dag-Erling Smorgrav 
References: <201104292300.p3TN0N8N019287@svn.freebsd.org>
In-Reply-To: <201104292300.p3TN0N8N019287@svn.freebsd.org>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221233 - head/sbin/fsck_ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 07:27:00 -0000

Dag-Erling Smorgrav wrote:
> Author: des
> Date: Fri Apr 29 23:00:23 2011
> New Revision: 221233
> URL: http://svn.freebsd.org/changeset/base/221233
> 
> Log:
>   Add an -E option to mirror newfs's.  The idea is that if you have a system
>   that was built before ffs grew support for TRIM, your filesystem will have
>   plenty of free blocks that the flash chip doesn't know are free, so it
>   can't take advantage of them for wear leveling.  Once you've upgraded your
>   kernel, you enable TRIM on the filesystem (tunefs -t enable), then run
>   fsck_ffs -E on it before mounting it.
>   
>   I tested this patch by half-filling an mdconfig'ed filesystem image,
>   running fsck_ffs -E on it, then verifying that the contents were not
>   damaged by comparing them to a pristine copy using rsync's checksum
>   functionality.  There is no reliable way to test it on real hardware.
>   
>   Many thanks to mckusick@, who provided the tricky parts of this patch and
>   reviewed the final version.
>   
>   Reviewed by:	mckusick@
>   MFC after:	3 weeks

Thank you!

Not exactly scientific test, but my laptop survived it fine with 10% and
50% of free space. And it indeed restored the write speed, respecting
that I had no kernel TRIM support enabled there before. For additional
check of the drive's block remapper behavior I've written all free space
with file of zeroes and deleted it -- after reboot I am still here. :)

-- 
Alexander Motin

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:04:35 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 41037106564A;
	Sat, 30 Apr 2011 11:04:35 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 305058FC0C;
	Sat, 30 Apr 2011 11:04:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UB4ZgJ042833;
	Sat, 30 Apr 2011 11:04:35 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UB4ZuC042830;
	Sat, 30 Apr 2011 11:04:35 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301104.p3UB4ZuC042830@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 11:04:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221247 - in head/sys: netinet netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:04:35 -0000

Author: bz
Date: Sat Apr 30 11:04:34 2011
New Revision: 221247
URL: http://svn.freebsd.org/changeset/base/221247

Log:
  Make the PCB code compile without INET support by adding #ifdef INETs
  and correcting few #includes.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/netinet/in_pcb.c
  head/sys/netinet6/in6_pcb.c

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Sat Apr 30 10:59:55 2011	(r221246)
+++ head/sys/netinet/in_pcb.c	Sat Apr 30 11:04:34 2011	(r221247)
@@ -65,17 +65,22 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#if defined(INET) || defined(INET6)
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#endif
+#ifdef INET
+#include 
+#endif
 #ifdef INET6
 #include 
-#include 
 #include 
+#include 
+#include 
 #endif /* INET6 */
 
 
@@ -117,12 +122,13 @@ static VNET_DEFINE(int, ipport_tcplastco
 
 #define	V_ipport_tcplastcount		VNET(ipport_tcplastcount)
 
+static void	in_pcbremlists(struct inpcb *inp);
+
+#ifdef INET
 #define RANGECHK(var, min, max) \
 	if ((var) < (min)) { (var) = (min); } \
 	else if ((var) > (max)) { (var) = (max); }
 
-static void	in_pcbremlists(struct inpcb *inp);
-
 static int
 sysctl_net_ipport_check(SYSCTL_HANDLER_ARGS)
 {
@@ -179,6 +185,7 @@ SYSCTL_VNET_INT(_net_inet_ip_portrange, 
 	&VNET_NAME(ipport_randomtime), 0,
 	"Minimum time to keep sequental port "
 	"allocation before switching to a random one");
+#endif
 
 /*
  * in_pcb.c: manage the Protocol Control Blocks.
@@ -291,6 +298,7 @@ out:
 	return (error);
 }
 
+#ifdef INET
 int
 in_pcbbind(struct inpcb *inp, struct sockaddr *nam, struct ucred *cred)
 {
@@ -316,6 +324,7 @@ in_pcbbind(struct inpcb *inp, struct soc
 		inp->inp_flags |= INP_ANONPORT;
 	return (0);
 }
+#endif
 
 #if defined(INET) || defined(INET6)
 int
@@ -396,6 +405,7 @@ in_pcb_lport(struct inpcb *inp, struct i
 		laddr = *laddrp;
 	}
 #endif
+	tmpinp = NULL;	/* Make compiler happy. */
 	lport = *lportp;
 
 	if (dorandom)
@@ -435,6 +445,7 @@ in_pcb_lport(struct inpcb *inp, struct i
 }
 #endif /* INET || INET6 */
 
+#ifdef INET
 /*
  * Set up a bind operation on a PCB, performing port allocation
  * as required, but do not actually modify the PCB. Callers can
@@ -998,6 +1009,7 @@ in_pcbdisconnect(struct inpcb *inp)
 	inp->inp_fport = 0;
 	in_pcbrehash(inp);
 }
+#endif
 
 /*
  * in_pcbdetach() is responsibe for disassociating a socket from an inpcb.
@@ -1046,8 +1058,10 @@ in_pcbfree_internal(struct inpcb *inp)
 #endif
 	if (inp->inp_options)
 		(void)m_free(inp->inp_options);
+#ifdef INET
 	if (inp->inp_moptions != NULL)
 		inp_freemoptions(inp->inp_moptions);
+#endif
 	inp->inp_vflag = 0;
 	crfree(inp->inp_cred);
 
@@ -1164,6 +1178,7 @@ in_pcbdrop(struct inpcb *inp)
 	}
 }
 
+#ifdef INET
 /*
  * Common routines to return the socket addresses associated with inpcbs.
  */
@@ -1527,6 +1542,7 @@ in_pcblookup_hash(struct inpcbinfo *pcbi
 
 	return (NULL);
 }
+#endif /* INET */
 
 /*
  * Insert PCB onto various hash lists.

Modified: head/sys/netinet6/in6_pcb.c
==============================================================================
--- head/sys/netinet6/in6_pcb.c	Sat Apr 30 10:59:55 2011	(r221246)
+++ head/sys/netinet6/in6_pcb.c	Sat Apr 30 11:04:34 2011	(r221247)
@@ -204,6 +204,7 @@ in6_pcbbind(register struct inpcb *inp, 
 				      == 0) && (inp->inp_cred->cr_uid !=
 				     t->inp_cred->cr_uid))
 					return (EADDRINUSE);
+#ifdef INET
 				if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 &&
 				    IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
 					struct sockaddr_in sin;
@@ -222,6 +223,7 @@ in6_pcbbind(register struct inpcb *inp, 
 					     t->inp_cred->cr_uid))
 						return (EADDRINUSE);
 				}
+#endif
 			}
 			t = in6_pcblookup_local(pcbinfo, &sin6->sin6_addr,
 			    lport, wild, cred);
@@ -229,6 +231,7 @@ in6_pcbbind(register struct inpcb *inp, 
 			    intotw(t)->tw_so_options :
 			    t->inp_socket->so_options)) == 0)
 				return (EADDRINUSE);
+#ifdef INET
 			if ((inp->inp_flags & IN6P_IPV6_V6ONLY) == 0 &&
 			    IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
 				struct sockaddr_in sin;
@@ -252,6 +255,7 @@ in6_pcbbind(register struct inpcb *inp, 
 				     INP_SOCKAF(t->inp_socket)))
 					return (EADDRINUSE);
 			}
+#endif
 		}
 		inp->in6p_laddr = sin6->sin6_addr;
 	}
@@ -496,11 +500,14 @@ in6_mapped_sockaddr(struct socket *so, s
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("in6_mapped_sockaddr: inp == NULL"));
 
+#ifdef INET
 	if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) {
 		error = in_getsockaddr(so, nam);
 		if (error == 0)
 			in6_sin_2_v4mapsin6_in_sock(nam);
-	} else {
+	} else
+#endif
+	{
 		/* scope issues will be handled in in6_getsockaddr(). */
 		error = in6_getsockaddr(so, nam);
 	}
@@ -517,11 +524,13 @@ in6_mapped_peeraddr(struct socket *so, s
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("in6_mapped_peeraddr: inp == NULL"));
 
+#ifdef INET
 	if ((inp->inp_vflag & (INP_IPV4 | INP_IPV6)) == INP_IPV4) {
 		error = in_getpeeraddr(so, nam);
 		if (error == 0)
 			in6_sin_2_v4mapsin6_in_sock(nam);
 	} else
+#endif
 	/* scope issues will be handled in in6_getpeeraddr(). */
 	error = in6_getpeeraddr(so, nam);
 

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:17:00 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 824441065672;
	Sat, 30 Apr 2011 11:17:00 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7108B8FC17;
	Sat, 30 Apr 2011 11:17:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBH0JS043239;
	Sat, 30 Apr 2011 11:17:00 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBH0Au043235;
	Sat, 30 Apr 2011 11:17:00 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301117.p3UBH0Au043235@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 11:17:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221248 - in head/sys: conf netinet netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:17:00 -0000

Author: bz
Date: Sat Apr 30 11:17:00 2011
New Revision: 221248
URL: http://svn.freebsd.org/changeset/base/221248

Log:
  Make the UDP code compile without INET.  Expose udp_usrreq.c to IPv6 only
  as well compiling out most functions adding or extending #ifdef INET
  coverage.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/conf/files
  head/sys/netinet/udp_usrreq.c
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Apr 30 11:04:34 2011	(r221247)
+++ head/sys/conf/files	Sat Apr 30 11:17:00 2011	(r221248)
@@ -2770,7 +2770,7 @@ netinet/tcp_syncache.c		optional inet
 netinet/tcp_timer.c		optional inet
 netinet/tcp_timewait.c		optional inet
 netinet/tcp_usrreq.c		optional inet
-netinet/udp_usrreq.c		optional inet
+netinet/udp_usrreq.c		optional inet | inet6
 netinet/libalias/alias.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_db.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_mod.c	optional libalias | netgraph_nat

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c	Sat Apr 30 11:04:34 2011	(r221247)
+++ head/sys/netinet/udp_usrreq.c	Sat Apr 30 11:17:00 2011	(r221248)
@@ -35,6 +35,7 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ipfw.h"
+#include "opt_inet.h"
 #include "opt_inet6.h"
 #include "opt_ipsec.h"
 
@@ -143,9 +144,12 @@ SYSCTL_VNET_STRUCT(_net_inet_udp, UDPCTL
     &VNET_NAME(udpstat), udpstat,
     "UDP statistics (struct udpstat, netinet/udp_var.h)");
 
+#ifdef INET
 static void	udp_detach(struct socket *so);
 static int	udp_output(struct inpcb *, struct mbuf *, struct sockaddr *,
 		    struct mbuf *, struct thread *);
+#endif
+
 #ifdef IPSEC
 #ifdef IPSEC_NAT_T
 #define	UF_ESPINUDP_ALL	(UF_ESPINUDP_NON_IKE|UF_ESPINUDP)
@@ -229,6 +233,7 @@ udp_destroy(void)
 }
 #endif
 
+#ifdef INET
 /*
  * Subroutine of udp_input(), which appends the provided mbuf chain to the
  * passed pcb/socket.  The caller must provide a sockaddr_in via udp_in that
@@ -272,7 +277,6 @@ udp_append(struct inpcb *inp, struct ip 
 		return;
 	}
 #ifdef IPSEC_NAT_T
-#ifdef INET
 	up = intoudpcb(inp);
 	KASSERT(up != NULL, ("%s: udpcb NULL", __func__));
 	if (up->u_flags & UF_ESPINUDP_ALL) {	/* IPSec UDP encaps. */
@@ -280,7 +284,6 @@ udp_append(struct inpcb *inp, struct ip 
 		if (n == NULL)				/* Consumed. */
 			return;
 	}
-#endif /* INET */
 #endif /* IPSEC_NAT_T */
 #endif /* IPSEC */
 #ifdef MAC
@@ -288,14 +291,14 @@ udp_append(struct inpcb *inp, struct ip 
 		m_freem(n);
 		return;
 	}
-#endif
+#endif /* MAC */
 	if (inp->inp_flags & INP_CONTROLOPTS ||
 	    inp->inp_socket->so_options & (SO_TIMESTAMP | SO_BINTIME)) {
 #ifdef INET6
 		if (inp->inp_vflag & INP_IPV6)
 			(void)ip6_savecontrol_v4(inp, n, &opts, NULL);
 		else
-#endif
+#endif /* INET6 */
 			ip_savecontrol(inp, &opts, ip, n);
 	}
 #ifdef INET6
@@ -306,7 +309,7 @@ udp_append(struct inpcb *inp, struct ip 
 		in6_sin_2_v4mapsin6(udp_in, &udp_in6);
 		append_sa = (struct sockaddr *)&udp_in6;
 	} else
-#endif
+#endif /* INET6 */
 		append_sa = (struct sockaddr *)udp_in;
 	m_adj(n, off);
 
@@ -598,6 +601,7 @@ badheadlocked:
 badunlocked:
 	m_freem(m);
 }
+#endif /* INET */
 
 /*
  * Notify a udp user of an asynchronous error; just wake up so that they can
@@ -621,6 +625,7 @@ udp_notify(struct inpcb *inp, int errno)
 	return (inp);
 }
 
+#ifdef INET
 void
 udp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
 {
@@ -666,6 +671,7 @@ udp_ctlinput(int cmd, struct sockaddr *s
 		in_pcbnotifyall(&V_udbinfo, faddr, inetctlerrmap[cmd],
 		    udp_notify);
 }
+#endif /* INET */
 
 static int
 udp_pcblist(SYSCTL_HANDLER_ARGS)
@@ -778,6 +784,7 @@ SYSCTL_PROC(_net_inet_udp, UDPCTL_PCBLIS
     CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0,
     udp_pcblist, "S,xinpcb", "List of active UDP sockets");
 
+#ifdef INET
 static int
 udp_getcred(SYSCTL_HANDLER_ARGS)
 {
@@ -817,6 +824,7 @@ udp_getcred(SYSCTL_HANDLER_ARGS)
 SYSCTL_PROC(_net_inet_udp, OID_AUTO, getcred,
     CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0,
     udp_getcred, "S,xucred", "Get the xucred of a UDP connection");
+#endif /* INET */
 
 int
 udp_ctloutput(struct socket *so, struct sockopt *sopt)
@@ -835,11 +843,15 @@ udp_ctloutput(struct socket *so, struct 
 		if (INP_CHECK_SOCKAF(so, AF_INET6)) {
 			INP_WUNLOCK(inp);
 			error = ip6_ctloutput(so, sopt);
-		} else {
+		}
+#endif
+#if defined(INET) && defined(INET6)
+		else
 #endif
+#ifdef INET
+		{
 			INP_WUNLOCK(inp);
 			error = ip_ctloutput(so, sopt);
-#ifdef INET6
 		}
 #endif
 		return (error);
@@ -911,6 +923,7 @@ udp_ctloutput(struct socket *so, struct 
 	return (error);
 }
 
+#ifdef INET
 static int
 udp_output(struct inpcb *inp, struct mbuf *m, struct sockaddr *addr,
     struct mbuf *control, struct thread *td)
@@ -1223,7 +1236,6 @@ release:
 
 
 #if defined(IPSEC) && defined(IPSEC_NAT_T)
-#ifdef INET
 /*
  * Potentially decap ESP in UDP frame.  Check for an ESP header
  * and optional marker; if present, strip the UDP header and
@@ -1355,7 +1367,6 @@ udp4_espdecap(struct inpcb *inp, struct 
 	(void) ipsec4_common_input(m, iphlen, ip->ip_p);
 	return (NULL);			/* NB: consumed, bypass processing. */
 }
-#endif /* INET */
 #endif /* defined(IPSEC) && defined(IPSEC_NAT_T) */
 
 static void
@@ -1410,6 +1421,7 @@ udp_attach(struct socket *so, int proto,
 	INP_INFO_WUNLOCK(&V_udbinfo);
 	return (0);
 }
+#endif /* INET */
 
 int
 udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f)
@@ -1432,6 +1444,7 @@ udp_set_kernel_tunneling(struct socket *
 	return (0);
 }
 
+#ifdef INET
 static int
 udp_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
 {
@@ -1553,6 +1566,7 @@ udp_send(struct socket *so, int flags, s
 	KASSERT(inp != NULL, ("udp_send: inp == NULL"));
 	return (udp_output(inp, m, addr, control, td));
 }
+#endif /* INET */
 
 int
 udp_shutdown(struct socket *so)
@@ -1567,6 +1581,7 @@ udp_shutdown(struct socket *so)
 	return (0);
 }
 
+#ifdef INET
 struct pr_usrreqs udp_usrreqs = {
 	.pru_abort =		udp_abort,
 	.pru_attach =		udp_attach,
@@ -1584,3 +1599,4 @@ struct pr_usrreqs udp_usrreqs = {
 	.pru_sosetlabel =	in_pcbsosetlabel,
 	.pru_close =		udp_close,
 };
+#endif /* INET */

Modified: head/sys/netinet6/udp6_usrreq.c
==============================================================================
--- head/sys/netinet6/udp6_usrreq.c	Sat Apr 30 11:04:34 2011	(r221247)
+++ head/sys/netinet6/udp6_usrreq.c	Sat Apr 30 11:17:00 2011	(r221248)
@@ -849,6 +849,7 @@ udp6_bind(struct socket *so, struct sock
 
 		if (IN6_IS_ADDR_UNSPECIFIED(&sin6_p->sin6_addr))
 			inp->inp_vflag |= INP_IPV4;
+#ifdef INET
 		else if (IN6_IS_ADDR_V4MAPPED(&sin6_p->sin6_addr)) {
 			struct sockaddr_in sin;
 
@@ -859,10 +860,13 @@ udp6_bind(struct socket *so, struct sock
 			    td->td_ucred);
 			goto out;
 		}
+#endif
 	}
 
 	error = in6_pcbbind(inp, nam, td->td_ucred);
+#ifdef INET
 out:
+#endif
 	INP_WUNLOCK(inp);
 	INP_INFO_WUNLOCK(&V_udbinfo);
 	return (error);
@@ -909,6 +913,7 @@ udp6_connect(struct socket *so, struct s
 
 	INP_INFO_WLOCK(&V_udbinfo);
 	INP_WLOCK(inp);
+#ifdef INET
 	if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
 		struct sockaddr_in sin;
 
@@ -932,6 +937,7 @@ udp6_connect(struct socket *so, struct s
 			soisconnected(so);
 		goto out;
 	}
+#endif
 	if (!IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_faddr)) {
 		error = EISCONN;
 		goto out;

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:18:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AD747106566C;
	Sat, 30 Apr 2011 11:18:16 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9BFAF8FC1A;
	Sat, 30 Apr 2011 11:18:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBIGVL043322;
	Sat, 30 Apr 2011 11:18:16 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBIGVE043318;
	Sat, 30 Apr 2011 11:18:16 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201104301118.p3UBIGVE043318@svn.freebsd.org>
From: Michael Tuexen 
Date: Sat, 30 Apr 2011 11:18:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221249 - in head/sys: netinet netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:18:16 -0000

Author: tuexen
Date: Sat Apr 30 11:18:16 2011
New Revision: 221249
URL: http://svn.freebsd.org/changeset/base/221249

Log:
  Improve compilation of SCTP code without INET support.
  Some bugs where fixed while doing this:
  * ASCONF-ACK messages might use wrong port number when using
    IPv6.
  * Checking for additional addresses takes the correct address
    into account and also does not do more comparisons than
    necessary.
  
  This patch is based on one received from bz@ who was
  sponsored by The FreeBSD Foundation and iXsystems.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_asconf.c
  head/sys/netinet/sctp_bsd_addr.c
  head/sys/netinet/sctp_input.c
  head/sys/netinet/sctp_os_bsd.h
  head/sys/netinet/sctp_output.c
  head/sys/netinet/sctp_pcb.c
  head/sys/netinet/sctp_sysctl.c
  head/sys/netinet/sctp_usrreq.c
  head/sys/netinet/sctp_var.h
  head/sys/netinet/sctputil.c
  head/sys/netinet6/sctp6_usrreq.c

Modified: head/sys/netinet/sctp_asconf.c
==============================================================================
--- head/sys/netinet/sctp_asconf.c	Sat Apr 30 11:17:00 2011	(r221248)
+++ head/sys/netinet/sctp_asconf.c	Sat Apr 30 11:18:16 2011	(r221249)
@@ -57,41 +57,51 @@ static void
 sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa)
 {
 	struct ip *iph;
+
+#ifdef INET
 	struct sockaddr_in *sin;
 
+#endif
 #ifdef INET6
 	struct sockaddr_in6 *sin6;
 
 #endif
 
 	iph = mtod(m, struct ip *);
-	if (iph->ip_v == IPVERSION) {
-		/* IPv4 source */
-		sin = (struct sockaddr_in *)sa;
-		bzero(sin, sizeof(*sin));
-		sin->sin_family = AF_INET;
-		sin->sin_len = sizeof(struct sockaddr_in);
-		sin->sin_port = 0;
-		sin->sin_addr.s_addr = iph->ip_src.s_addr;
-		return;
-	}
+	switch (iph->ip_v) {
+#ifdef INET
+	case IPVERSION:
+		{
+			/* IPv4 source */
+			sin = (struct sockaddr_in *)sa;
+			bzero(sin, sizeof(*sin));
+			sin->sin_family = AF_INET;
+			sin->sin_len = sizeof(struct sockaddr_in);
+			sin->sin_port = 0;
+			sin->sin_addr.s_addr = iph->ip_src.s_addr;
+			break;
+		}
+#endif
 #ifdef INET6
-	else if (iph->ip_v == (IPV6_VERSION >> 4)) {
-		/* IPv6 source */
-		struct ip6_hdr *ip6;
+	case (IPV6_VERSION >> 4):
+		{
+			/* IPv6 source */
+			struct ip6_hdr *ip6;
 
-		sin6 = (struct sockaddr_in6 *)sa;
-		bzero(sin6, sizeof(*sin6));
-		sin6->sin6_family = AF_INET6;
-		sin6->sin6_len = sizeof(struct sockaddr_in6);
-		sin6->sin6_port = 0;
-		ip6 = mtod(m, struct ip6_hdr *);
-		sin6->sin6_addr = ip6->ip6_src;
-		return;
-	}
+			sin6 = (struct sockaddr_in6 *)sa;
+			bzero(sin6, sizeof(*sin6));
+			sin6->sin6_family = AF_INET6;
+			sin6->sin6_len = sizeof(struct sockaddr_in6);
+			sin6->sin6_port = 0;
+			ip6 = mtod(m, struct ip6_hdr *);
+			sin6->sin6_addr = ip6->ip6_src;
+			break;
+		}
 #endif				/* INET6 */
-	else
-		return;
+	default:
+		break;
+	}
+	return;
 }
 
 /*
@@ -192,33 +202,36 @@ sctp_process_asconf_add_ip(struct mbuf *
 {
 	struct mbuf *m_reply = NULL;
 	struct sockaddr_storage sa_source, sa_store;
-	struct sctp_ipv4addr_param *v4addr;
+	struct sctp_paramhdr *ph;
 	uint16_t param_type, param_length, aparam_length;
 	struct sockaddr *sa;
-	struct sockaddr_in *sin;
 	int zero_address = 0;
 
+#ifdef INET
+	struct sockaddr_in *sin;
+	struct sctp_ipv4addr_param *v4addr;
+
+#endif
 #ifdef INET6
 	struct sockaddr_in6 *sin6;
 	struct sctp_ipv6addr_param *v6addr;
 
-#endif				/* INET6 */
+#endif
 
 	aparam_length = ntohs(aph->ph.param_length);
-	v4addr = (struct sctp_ipv4addr_param *)(aph + 1);
-#ifdef INET6
-	v6addr = (struct sctp_ipv6addr_param *)(aph + 1);
-#endif				/* INET6 */
-	param_type = ntohs(v4addr->ph.param_type);
-	param_length = ntohs(v4addr->ph.param_length);
+	ph = (struct sctp_paramhdr *)(aph + 1);
+	param_type = ntohs(ph->param_type);
+	param_length = ntohs(ph->param_length);
 
 	sa = (struct sockaddr *)&sa_store;
 	switch (param_type) {
+#ifdef INET
 	case SCTP_IPV4_ADDRESS:
 		if (param_length != sizeof(struct sctp_ipv4addr_param)) {
 			/* invalid param size */
 			return NULL;
 		}
+		v4addr = (struct sctp_ipv4addr_param *)ph;
 		sin = (struct sockaddr_in *)&sa_store;
 		bzero(sin, sizeof(*sin));
 		sin->sin_family = AF_INET;
@@ -230,12 +243,14 @@ sctp_process_asconf_add_ip(struct mbuf *
 		SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding ");
 		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
 		break;
-	case SCTP_IPV6_ADDRESS:
+#endif
 #ifdef INET6
+	case SCTP_IPV6_ADDRESS:
 		if (param_length != sizeof(struct sctp_ipv6addr_param)) {
 			/* invalid param size */
 			return NULL;
 		}
+		v6addr = (struct sctp_ipv6addr_param *)ph;
 		sin6 = (struct sockaddr_in6 *)&sa_store;
 		bzero(sin6, sizeof(*sin6));
 		sin6->sin6_family = AF_INET6;
@@ -247,18 +262,13 @@ sctp_process_asconf_add_ip(struct mbuf *
 			zero_address = 1;
 		SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: adding ");
 		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
-#else
-		/* IPv6 not enabled! */
-		/* FIX ME: currently sends back an invalid param error */
-		m_reply = sctp_asconf_error_response(aph->correlation_id,
-		    SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length);
-		SCTPDBG(SCTP_DEBUG_ASCONF1,
-		    "process_asconf_add_ip: v6 disabled- skipping ");
-		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
-		return m_reply;
-#endif
 		break;
+#endif
 	default:
+		/*
+		 * XXX: Is this the correct error cause? Maybe
+		 * SCTP_CAUSE_INVALID_PARAM is a better choice.
+		 */
 		m_reply = sctp_asconf_error_response(aph->correlation_id,
 		    SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
 		    aparam_length);
@@ -293,7 +303,6 @@ sctp_process_asconf_add_ip(struct mbuf *
 		sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, stcb->sctp_ep,
 		    stcb, NULL);
 	}
-
 	return m_reply;
 }
 
@@ -331,37 +340,40 @@ sctp_process_asconf_delete_ip(struct mbu
 {
 	struct mbuf *m_reply = NULL;
 	struct sockaddr_storage sa_source, sa_store;
-	struct sctp_ipv4addr_param *v4addr;
+	struct sctp_paramhdr *ph;
 	uint16_t param_type, param_length, aparam_length;
 	struct sockaddr *sa;
-	struct sockaddr_in *sin;
 	int zero_address = 0;
 	int result;
 
+#ifdef INET
+	struct sockaddr_in *sin;
+	struct sctp_ipv4addr_param *v4addr;
+
+#endif
 #ifdef INET6
 	struct sockaddr_in6 *sin6;
 	struct sctp_ipv6addr_param *v6addr;
 
-#endif				/* INET6 */
+#endif
 
 	/* get the source IP address for src and 0.0.0.0/::0 delete checks */
 	sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source);
 
 	aparam_length = ntohs(aph->ph.param_length);
-	v4addr = (struct sctp_ipv4addr_param *)(aph + 1);
-#ifdef INET6
-	v6addr = (struct sctp_ipv6addr_param *)(aph + 1);
-#endif				/* INET6 */
-	param_type = ntohs(v4addr->ph.param_type);
-	param_length = ntohs(v4addr->ph.param_length);
+	ph = (struct sctp_paramhdr *)(aph + 1);
+	param_type = ntohs(ph->param_type);
+	param_length = ntohs(ph->param_length);
 
 	sa = (struct sockaddr *)&sa_store;
 	switch (param_type) {
+#ifdef INET
 	case SCTP_IPV4_ADDRESS:
 		if (param_length != sizeof(struct sctp_ipv4addr_param)) {
 			/* invalid param size */
 			return NULL;
 		}
+		v4addr = (struct sctp_ipv4addr_param *)ph;
 		sin = (struct sockaddr_in *)&sa_store;
 		bzero(sin, sizeof(*sin));
 		sin->sin_family = AF_INET;
@@ -374,12 +386,14 @@ sctp_process_asconf_delete_ip(struct mbu
 		    "process_asconf_delete_ip: deleting ");
 		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
 		break;
+#endif
+#ifdef INET6
 	case SCTP_IPV6_ADDRESS:
 		if (param_length != sizeof(struct sctp_ipv6addr_param)) {
 			/* invalid param size */
 			return NULL;
 		}
-#ifdef INET6
+		v6addr = (struct sctp_ipv6addr_param *)ph;
 		sin6 = (struct sockaddr_in6 *)&sa_store;
 		bzero(sin6, sizeof(*sin6));
 		sin6->sin6_family = AF_INET6;
@@ -392,15 +406,8 @@ sctp_process_asconf_delete_ip(struct mbu
 		SCTPDBG(SCTP_DEBUG_ASCONF1,
 		    "process_asconf_delete_ip: deleting ");
 		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
-#else
-		/* IPv6 not enabled!  No "action" needed; just ack it */
-		SCTPDBG(SCTP_DEBUG_ASCONF1,
-		    "process_asconf_delete_ip: v6 disabled- ignoring: ");
-		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
-		/* just respond with a "success" ASCONF-ACK */
-		return NULL;
-#endif
 		break;
+#endif
 	default:
 		m_reply = sctp_asconf_error_response(aph->correlation_id,
 		    SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
@@ -466,33 +473,36 @@ sctp_process_asconf_set_primary(struct m
 {
 	struct mbuf *m_reply = NULL;
 	struct sockaddr_storage sa_source, sa_store;
-	struct sctp_ipv4addr_param *v4addr;
+	struct sctp_paramhdr *ph;
 	uint16_t param_type, param_length, aparam_length;
 	struct sockaddr *sa;
-	struct sockaddr_in *sin;
 	int zero_address = 0;
 
+#ifdef INET
+	struct sockaddr_in *sin;
+	struct sctp_ipv4addr_param *v4addr;
+
+#endif
 #ifdef INET6
 	struct sockaddr_in6 *sin6;
 	struct sctp_ipv6addr_param *v6addr;
 
-#endif				/* INET6 */
+#endif
 
 	aparam_length = ntohs(aph->ph.param_length);
-	v4addr = (struct sctp_ipv4addr_param *)(aph + 1);
-#ifdef INET6
-	v6addr = (struct sctp_ipv6addr_param *)(aph + 1);
-#endif				/* INET6 */
-	param_type = ntohs(v4addr->ph.param_type);
-	param_length = ntohs(v4addr->ph.param_length);
+	ph = (struct sctp_paramhdr *)(aph + 1);
+	param_type = ntohs(ph->param_type);
+	param_length = ntohs(ph->param_length);
 
 	sa = (struct sockaddr *)&sa_store;
 	switch (param_type) {
+#ifdef INET
 	case SCTP_IPV4_ADDRESS:
 		if (param_length != sizeof(struct sctp_ipv4addr_param)) {
 			/* invalid param size */
 			return NULL;
 		}
+		v4addr = (struct sctp_ipv4addr_param *)ph;
 		sin = (struct sockaddr_in *)&sa_store;
 		bzero(sin, sizeof(*sin));
 		sin->sin_family = AF_INET;
@@ -503,12 +513,14 @@ sctp_process_asconf_set_primary(struct m
 		SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: ");
 		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
 		break;
+#endif
+#ifdef INET6
 	case SCTP_IPV6_ADDRESS:
 		if (param_length != sizeof(struct sctp_ipv6addr_param)) {
 			/* invalid param size */
 			return NULL;
 		}
-#ifdef INET6
+		v6addr = (struct sctp_ipv6addr_param *)ph;
 		sin6 = (struct sockaddr_in6 *)&sa_store;
 		bzero(sin6, sizeof(*sin6));
 		sin6->sin6_family = AF_INET6;
@@ -519,15 +531,8 @@ sctp_process_asconf_set_primary(struct m
 			zero_address = 1;
 		SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: ");
 		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
-#else
-		/* IPv6 not enabled!  No "action" needed; just ack it */
-		SCTPDBG(SCTP_DEBUG_ASCONF1,
-		    "process_asconf_set_primary: v6 disabled- ignoring: ");
-		SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa);
-		/* just respond with a "success" ASCONF-ACK */
-		return NULL;
-#endif
 		break;
+#endif
 	default:
 		m_reply = sctp_asconf_error_response(aph->correlation_id,
 		    SCTP_CAUSE_UNRESOLVABLE_ADDR, (uint8_t *) aph,
@@ -655,7 +660,7 @@ sctp_handle_asconf(struct mbuf *m, unsig
 
 	if (first) {
 		/* delete old cache */
-		SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing firstASCONF. Try to delte old cache\n");
+		SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: Now processing first ASCONF. Try to delete old cache\n");
 
 		TAILQ_FOREACH_SAFE(ack, &asoc->asconf_ack_sent, next, ack_next) {
 			if (ack->serial_number == serial_num)
@@ -825,10 +830,8 @@ send_reply:
 	ack->last_sent_to = NULL;
 	ack->data = m_ack;
 	ack->len = 0;
-	n = m_ack;
-	while (n) {
+	for (n = m_ack; n != NULL; n = SCTP_BUF_NEXT(n)) {
 		ack->len += SCTP_BUF_LEN(n);
-		n = SCTP_BUF_NEXT(n);
 	}
 	TAILQ_INSERT_TAIL(&stcb->asoc.asconf_ack_sent, ack, next);
 
@@ -846,12 +849,13 @@ send_reply:
 		SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n");
 		/* pullup already done, IP options already stripped */
 		iph = mtod(m, struct ip *);
-		sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph));
 		switch (iph->ip_v) {
+#ifdef INET
 		case IPVERSION:
 			{
 				struct sockaddr_in *from4;
 
+				sh = (struct sctphdr *)((caddr_t)iph + sizeof(*iph));
 				from4 = (struct sockaddr_in *)&from_store;
 				bzero(from4, sizeof(*from4));
 				from4->sin_family = AF_INET;
@@ -860,6 +864,7 @@ send_reply:
 				from4->sin_port = sh->src_port;
 				break;
 			}
+#endif
 #ifdef INET6
 		case IPV6_VERSION >> 4:
 			{
@@ -867,6 +872,7 @@ send_reply:
 				struct sockaddr_in6 *from6;
 
 				ip6 = mtod(m, struct ip6_hdr *);
+				sh = (struct sctphdr *)((caddr_t)ip6 + sizeof(*ip6));
 				from6 = (struct sockaddr_in6 *)&from_store;
 				bzero(from6, sizeof(*from6));
 				from6->sin6_family = AF_INET6;
@@ -908,28 +914,36 @@ send_reply:
 static uint32_t
 sctp_asconf_addr_match(struct sctp_asconf_addr *aa, struct sockaddr *sa)
 {
+	switch (sa->sa_family) {
 #ifdef INET6
-	if (sa->sa_family == AF_INET6) {
-		/* IPv6 sa address */
-		/* XXX scopeid */
-		struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-
-		if ((aa->ap.addrp.ph.param_type == SCTP_IPV6_ADDRESS) &&
-		    (memcmp(&aa->ap.addrp.addr, &sin6->sin6_addr,
-		    sizeof(struct in6_addr)) == 0)) {
-			return (1);
+	case AF_INET6:
+		{
+			/* XXX scopeid */
+			struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
+
+			if ((aa->ap.addrp.ph.param_type == SCTP_IPV6_ADDRESS) &&
+			    (memcmp(&aa->ap.addrp.addr, &sin6->sin6_addr,
+			    sizeof(struct in6_addr)) == 0)) {
+				return (1);
+			}
+			break;
 		}
-	} else
-#endif				/* INET6 */
-	if (sa->sa_family == AF_INET) {
-		/* IPv4 sa address */
-		struct sockaddr_in *sin = (struct sockaddr_in *)sa;
-
-		if ((aa->ap.addrp.ph.param_type == SCTP_IPV4_ADDRESS) &&
-		    (memcmp(&aa->ap.addrp.addr, &sin->sin_addr,
-		    sizeof(struct in_addr)) == 0)) {
-			return (1);
+#endif
+#ifdef INET
+	case AF_INET:
+		{
+			struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+
+			if ((aa->ap.addrp.ph.param_type == SCTP_IPV4_ADDRESS) &&
+			    (memcmp(&aa->ap.addrp.addr, &sin->sin_addr,
+			    sizeof(struct in_addr)) == 0)) {
+				return (1);
+			}
+			break;
 		}
+#endif
+	default:
+		break;
 	}
 	return (0);
 }
@@ -938,43 +952,48 @@ sctp_asconf_addr_match(struct sctp_ascon
  * does the address match? returns 0 if not, 1 if so
  */
 static uint32_t
-sctp_addr_match(
-    struct sctp_ipv6addr_param *v6addr,
-    struct sockaddr *sa)
+sctp_addr_match(struct sctp_paramhdr *ph, struct sockaddr *sa)
 {
 	uint16_t param_type, param_length;
-	struct sctp_ipv4addr_param *v4addr = (struct sctp_ipv4addr_param *)v6addr;
 
+	param_type = ntohs(ph->param_type);
+	param_length = ntohs(ph->param_length);
+	switch (sa->sa_family) {
 #ifdef INET6
-	if (sa->sa_family == AF_INET6) {
-		/* IPv6 sa address */
-		/* XXX scopeid */
-		struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-
-		param_type = ntohs(v6addr->ph.param_type);
-		param_length = ntohs(v6addr->ph.param_length);
-
-		if ((param_type == SCTP_IPV6_ADDRESS) &&
-		    param_length == sizeof(struct sctp_ipv6addr_param) &&
-		    (memcmp(&v6addr->addr, &sin6->sin6_addr,
-		    sizeof(struct in6_addr)) == 0)) {
-			return (1);
+	case AF_INET6:
+		{
+			/* XXX scopeid */
+			struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
+			struct sctp_ipv6addr_param *v6addr;
+
+			v6addr = (struct sctp_ipv6addr_param *)ph;
+			if ((param_type == SCTP_IPV6_ADDRESS) &&
+			    param_length == sizeof(struct sctp_ipv6addr_param) &&
+			    (memcmp(&v6addr->addr, &sin6->sin6_addr,
+			    sizeof(struct in6_addr)) == 0)) {
+				return (1);
+			}
+			break;
 		}
-	}
 #endif
-	if (sa->sa_family == AF_INET) {
-		/* IPv4 sa address */
-		struct sockaddr_in *sin = (struct sockaddr_in *)sa;
-
-		param_type = ntohs(v4addr->ph.param_type);
-		param_length = ntohs(v4addr->ph.param_length);
-
-		if ((param_type == SCTP_IPV4_ADDRESS) &&
-		    param_length == sizeof(struct sctp_ipv4addr_param) &&
-		    (memcmp(&v4addr->addr, &sin->sin_addr,
-		    sizeof(struct in_addr)) == 0)) {
-			return (1);
+#ifdef INET
+	case AF_INET:
+		{
+			struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+			struct sctp_ipv4addr_param *v4addr;
+
+			v4addr = (struct sctp_ipv4addr_param *)ph;
+			if ((param_type == SCTP_IPV4_ADDRESS) &&
+			    param_length == sizeof(struct sctp_ipv4addr_param) &&
+			    (memcmp(&v4addr->addr, &sin->sin_addr,
+			    sizeof(struct in_addr)) == 0)) {
+				return (1);
+			}
+			break;
 		}
+#endif
+	default:
+		break;
 	}
 	return (0);
 }
@@ -1179,17 +1198,25 @@ sctp_path_check_and_react(struct sctp_tc
 			continue;
 
 		changed = 0;
-		if (net->ro._l_addr.sa.sa_family == AF_INET) {
-			if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro))
+		switch (net->ro._l_addr.sa.sa_family) {
+#ifdef INET
+		case AF_INET:
+			if (sctp_v4src_match_nexthop(newifa, (sctp_route_t *) & net->ro)) {
 				changed = 1;
-		}
+			}
+			break;
+#endif
 #ifdef INET6
-		if (net->ro._l_addr.sa.sa_family == AF_INET6) {
+		case AF_INET6:
 			if (sctp_v6src_match_nexthop(
-			    &newifa->address.sin6, (sctp_route_t *) & net->ro))
+			    &newifa->address.sin6, (sctp_route_t *) & net->ro)) {
 				changed = 1;
-		}
+			}
+			break;
 #endif
+		default:
+			break;
+		}
 		/*
 		 * if the newly added address does not relate routing
 		 * information, we skip.
@@ -1316,31 +1343,40 @@ sctp_asconf_queue_mgmt(struct sctp_tcb *
 	aa->ifa = ifa;
 	atomic_add_int(&ifa->refcount, 1);
 	/* correlation_id filled in during send routine later... */
-	if (ifa->address.sa.sa_family == AF_INET6) {
-		/* IPv6 address */
-		struct sockaddr_in6 *sin6;
+	switch (ifa->address.sa.sa_family) {
+#ifdef INET6
+	case AF_INET6:
+		{
+			struct sockaddr_in6 *sin6;
 
-		sin6 = (struct sockaddr_in6 *)&ifa->address.sa;
-		sa = (struct sockaddr *)sin6;
-		aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS;
-		aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param));
-		aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) +
-		    sizeof(struct sctp_ipv6addr_param);
-		memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr,
-		    sizeof(struct in6_addr));
-	} else if (ifa->address.sa.sa_family == AF_INET) {
-		/* IPv4 address */
-		struct sockaddr_in *sin;
+			sin6 = (struct sockaddr_in6 *)&ifa->address.sa;
+			sa = (struct sockaddr *)sin6;
+			aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS;
+			aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param));
+			aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) +
+			    sizeof(struct sctp_ipv6addr_param);
+			memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr,
+			    sizeof(struct in6_addr));
+			break;
+		}
+#endif
+#ifdef INET
+	case AF_INET:
+		{
+			struct sockaddr_in *sin;
 
-		sin = (struct sockaddr_in *)&ifa->address.sa;
-		sa = (struct sockaddr *)sin;
-		aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS;
-		aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param));
-		aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) +
-		    sizeof(struct sctp_ipv4addr_param);
-		memcpy(&aa->ap.addrp.addr, &sin->sin_addr,
-		    sizeof(struct in_addr));
-	} else {
+			sin = (struct sockaddr_in *)&ifa->address.sa;
+			sa = (struct sockaddr *)sin;
+			aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS;
+			aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param));
+			aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) +
+			    sizeof(struct sctp_ipv4addr_param);
+			memcpy(&aa->ap.addrp.addr, &sin->sin_addr,
+			    sizeof(struct in_addr));
+			break;
+		}
+#endif
+	default:
 		/* invalid family! */
 		SCTP_FREE(aa, SCTP_M_ASC_ADDR);
 		sctp_free_ifa(ifa);
@@ -1522,26 +1558,37 @@ sctp_asconf_queue_sa_delete(struct sctp_
 	if (ifa)
 		atomic_add_int(&ifa->refcount, 1);
 	/* correlation_id filled in during send routine later... */
-	if (sa->sa_family == AF_INET6) {
-		/* IPv6 address */
-		struct sockaddr_in6 *sin6;
+	switch (sa->sa_family) {
+#ifdef INET6
+	case AF_INET6:
+		{
+			/* IPv6 address */
+			struct sockaddr_in6 *sin6;
 
-		sin6 = (struct sockaddr_in6 *)sa;
-		aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS;
-		aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param));
-		aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv6addr_param);
-		memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr,
-		    sizeof(struct in6_addr));
-	} else if (sa->sa_family == AF_INET) {
-		/* IPv4 address */
-		struct sockaddr_in *sin = (struct sockaddr_in *)sa;
+			sin6 = (struct sockaddr_in6 *)sa;
+			aa->ap.addrp.ph.param_type = SCTP_IPV6_ADDRESS;
+			aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv6addr_param));
+			aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv6addr_param);
+			memcpy(&aa->ap.addrp.addr, &sin6->sin6_addr,
+			    sizeof(struct in6_addr));
+			break;
+		}
+#endif
+#ifdef INET
+	case AF_INET:
+		{
+			/* IPv4 address */
+			struct sockaddr_in *sin = (struct sockaddr_in *)sa;
 
-		aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS;
-		aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param));
-		aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv4addr_param);
-		memcpy(&aa->ap.addrp.addr, &sin->sin_addr,
-		    sizeof(struct in_addr));
-	} else {
+			aa->ap.addrp.ph.param_type = SCTP_IPV4_ADDRESS;
+			aa->ap.addrp.ph.param_length = (sizeof(struct sctp_ipv4addr_param));
+			aa->ap.aph.ph.param_length = sizeof(struct sctp_asconf_paramhdr) + sizeof(struct sctp_ipv4addr_param);
+			memcpy(&aa->ap.addrp.addr, &sin->sin_addr,
+			    sizeof(struct in_addr));
+			break;
+		}
+#endif
+	default:
 		/* invalid family! */
 		SCTP_FREE(aa, SCTP_M_ASC_ADDR);
 		if (ifa)
@@ -1923,10 +1970,19 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *
 	 */
 
 	/* first, make sure it's a good address family */
-	if (ifa->address.sa.sa_family != AF_INET6 &&
-	    ifa->address.sa.sa_family != AF_INET) {
+	switch (ifa->address.sa.sa_family) {
+#ifdef INET6
+	case AF_INET6:
+		break;
+#endif
+#ifdef INET
+	case AF_INET:
+		break;
+#endif
+	default:
 		return;
 	}
+#ifdef INET6
 	/* make sure we're "allowed" to add this type of addr */
 	if (ifa->address.sa.sa_family == AF_INET6) {
 		/* invalid if we're not a v6 endpoint */
@@ -1937,6 +1993,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *
 			return;
 		}
 	}
+#endif
 	/* put this address on the "pending/do not use yet" list */
 	sctp_add_local_addr_restricted(stcb, ifa);
 	/*
@@ -1971,6 +2028,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *
 			break;
 		}
 #endif
+#ifdef INET
 	case AF_INET:
 		{
 			struct sockaddr_in *sin;
@@ -1993,6 +2051,7 @@ sctp_addr_mgmt_assoc(struct sctp_inpcb *
 			}
 			break;
 		}
+#endif
 	default:
 		/* else, not AF_INET or AF_INET6, so skip */
 		return;
@@ -2036,35 +2095,38 @@ sctp_asconf_iterator_ep(struct sctp_inpc
 	asc = (struct sctp_asconf_iterator *)ptr;
 	LIST_FOREACH(l, &asc->list_of_work, sctp_nxt_addr) {
 		ifa = l->ifa;
-		if (ifa->address.sa.sa_family == AF_INET6) {
+		switch (ifa->address.sa.sa_family) {
+#ifdef INET6
+		case AF_INET6:
 			/* invalid if we're not a v6 endpoint */
 			if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) == 0) {
 				cnt_invalid++;
 				if (asc->cnt == cnt_invalid)
 					return (1);
-				else
-					continue;
 			}
-		} else if (ifa->address.sa.sa_family == AF_INET) {
-			/* invalid if we are a v6 only endpoint */
-			struct in6pcb *inp6;
+			break;
+#endif
+#ifdef INET
+		case AF_INET:
+			{
+				/* invalid if we are a v6 only endpoint */
+				struct in6pcb *inp6;
 
-			inp6 = (struct in6pcb *)&inp->ip_inp.inp;
-			if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
-			    SCTP_IPV6_V6ONLY(inp6)) {
-				cnt_invalid++;
-				if (asc->cnt == cnt_invalid)
-					return (1);
-				else
-					continue;
+				inp6 = (struct in6pcb *)&inp->ip_inp.inp;
+				if ((inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) &&
+				    SCTP_IPV6_V6ONLY(inp6)) {
+					cnt_invalid++;
+					if (asc->cnt == cnt_invalid)
+						return (1);
+				}
+				break;
 			}
-		} else {
+#endif
+		default:
 			/* invalid address family */
 			cnt_invalid++;
 			if (asc->cnt == cnt_invalid)
 				return (1);
-			else
-				continue;
 		}
 	}
 	return (0);
@@ -2153,6 +2215,7 @@ sctp_asconf_iterator_stcb(struct sctp_in
 				break;
 			}
 #endif
+#ifdef INET
 		case AF_INET:
 			{
 				/* invalid if we are a v6 only endpoint */
@@ -2184,6 +2247,7 @@ sctp_asconf_iterator_stcb(struct sctp_in
 				}
 				break;
 			}
+#endif
 		default:
 			/* invalid address family */
 			cnt_invalid++;
@@ -2374,7 +2438,7 @@ sctp_is_addr_pending(struct sctp_tcb *st
 	struct sctp_asconf_chunk *acp;
 	struct sctp_asconf_paramhdr *aph;
 	uint8_t aparam_buf[SCTP_PARAM_BUFFER_SIZE];
-	struct sctp_ipv6addr_param *p_addr;
+	struct sctp_paramhdr *ph;
 	int add_cnt, del_cnt;
 	uint16_t last_param_type;
 
@@ -2389,12 +2453,12 @@ sctp_is_addr_pending(struct sctp_tcb *st
 		acp = mtod(chk->data, struct sctp_asconf_chunk *);
 		offset += sizeof(struct sctp_asconf_chunk);
 		asconf_limit = ntohs(acp->ch.chunk_length);
-		p_addr = (struct sctp_ipv6addr_param *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_paramhdr), aparam_buf);
-		if (p_addr == NULL) {
+		ph = (struct sctp_paramhdr *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_paramhdr), aparam_buf);
+		if (ph == NULL) {
 			SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get lookup addr!\n");
 			continue;
 		}
-		offset += ntohs(p_addr->ph.param_length);
+		offset += ntohs(ph->param_length);
 
 		aph = (struct sctp_asconf_paramhdr *)sctp_m_getptr(chk->data, offset, sizeof(struct sctp_asconf_paramhdr), aparam_buf);
 		if (aph == NULL) {
@@ -2423,8 +2487,8 @@ sctp_is_addr_pending(struct sctp_tcb *st
 				SCTPDBG(SCTP_DEBUG_ASCONF1, "is_addr_pending: couldn't get entire param\n");
 				break;
 			}
-			p_addr = (struct sctp_ipv6addr_param *)(aph + 1);
-			if (sctp_addr_match(p_addr, &sctp_ifa->address.sa) != 0) {
+			ph = (struct sctp_paramhdr *)(aph + 1);
+			if (sctp_addr_match(ph, &sctp_ifa->address.sa) != 0) {
 				switch (param_type) {
 				case SCTP_ADD_IP_ADDRESS:
 					add_cnt++;
@@ -2480,52 +2544,72 @@ sctp_find_valid_localaddr(struct sctp_tc
 			continue;
 		}
 		LIST_FOREACH(sctp_ifa, &sctp_ifn->ifalist, next_ifa) {
-			if (sctp_ifa->address.sa.sa_family == AF_INET &&
-			    stcb->asoc.ipv4_addr_legal) {
-				struct sockaddr_in *sin;
+			switch (sctp_ifa->address.sa.sa_family) {
+#ifdef INET
+			case AF_INET:
+				if (stcb->asoc.ipv4_addr_legal) {
+					struct sockaddr_in *sin;
+
+					sin = (struct sockaddr_in *)&sctp_ifa->address.sa;
+					if (sin->sin_addr.s_addr == 0) {
+						/* skip unspecifed addresses */
+						continue;
+					}
+					if (stcb->asoc.ipv4_local_scope == 0 &&
+					    IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))
+						continue;
 
-				sin = (struct sockaddr_in *)&sctp_ifa->address.sa;
-				if (sin->sin_addr.s_addr == 0) {
-					/* skip unspecifed addresses */
-					continue;
+					if (sctp_is_addr_restricted(stcb, sctp_ifa) &&
+					    (!sctp_is_addr_pending(stcb, sctp_ifa)))
+						continue;
+					/*
+					 * found a valid local v4 address to
+					 * use
+					 */
+					if (addr_locked == SCTP_ADDR_NOT_LOCKED)
+						SCTP_IPI_ADDR_RUNLOCK();
+					return (&sctp_ifa->address.sa);
 				}
-				if (stcb->asoc.ipv4_local_scope == 0 &&
-				    IN4_ISPRIVATE_ADDRESS(&sin->sin_addr))
-					continue;
+				break;
+#endif
+#ifdef INET6
+			case AF_INET6:
+				if (stcb->asoc.ipv6_addr_legal) {
+					struct sockaddr_in6 *sin6;
 
-				if (sctp_is_addr_restricted(stcb, sctp_ifa) &&
-				    (!sctp_is_addr_pending(stcb, sctp_ifa)))
-					continue;
-				/* found a valid local v4 address to use */
-				if (addr_locked == SCTP_ADDR_NOT_LOCKED)
-					SCTP_IPI_ADDR_RUNLOCK();
-				return (&sctp_ifa->address.sa);
-			} else if (sctp_ifa->address.sa.sa_family == AF_INET6 &&
-			    stcb->asoc.ipv6_addr_legal) {
-				struct sockaddr_in6 *sin6;
+					if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) {
+						continue;
+					}
+					sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa;
+					if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
+						/*
+						 * we skip unspecifed
+						 * addresses
+						 */
+						continue;
+					}
+					if (stcb->asoc.local_scope == 0 &&
+					    IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
+						continue;
+					if (stcb->asoc.site_scope == 0 &&
+					    IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))
+						continue;
 
-				if (sctp_ifa->localifa_flags & SCTP_ADDR_IFA_UNUSEABLE) {
-					continue;
-				}
-				sin6 = (struct sockaddr_in6 *)&sctp_ifa->address.sa;
-				if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
-					/* we skip unspecifed addresses */
-					continue;
+					if (sctp_is_addr_restricted(stcb, sctp_ifa) &&
+					    (!sctp_is_addr_pending(stcb, sctp_ifa)))
+						continue;
+					/*
+					 * found a valid local v6 address to
+					 * use
+					 */
+					if (addr_locked == SCTP_ADDR_NOT_LOCKED)
+						SCTP_IPI_ADDR_RUNLOCK();
+					return (&sctp_ifa->address.sa);
 				}
-				if (stcb->asoc.local_scope == 0 &&
-				    IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
-					continue;
-				if (stcb->asoc.site_scope == 0 &&
-				    IN6_IS_ADDR_SITELOCAL(&sin6->sin6_addr))
-					continue;
-
-				if (sctp_is_addr_restricted(stcb, sctp_ifa) &&
-				    (!sctp_is_addr_pending(stcb, sctp_ifa)))
-					continue;
-				/* found a valid local v6 address to use */
-				if (addr_locked == SCTP_ADDR_NOT_LOCKED)
-					SCTP_IPI_ADDR_RUNLOCK();
-				return (&sctp_ifa->address.sa);
+				break;
+#endif
+			default:
+				break;
 			}
 		}
 	}
@@ -2697,7 +2781,9 @@ sctp_compose_asconf(struct sctp_tcb *stc
 
 		lookup = (struct sctp_ipv6addr_param *)lookup_ptr;
 		if (found_addr != NULL) {
-			if (found_addr->sa_family == AF_INET6) {
+			switch (found_addr->sa_family) {
+#ifdef INET6
+			case AF_INET6:
 				/* copy IPv6 address */
 				lookup->ph.param_type =
 				    htons(SCTP_IPV6_ADDRESS);
@@ -2705,7 +2791,10 @@ sctp_compose_asconf(struct sctp_tcb *stc
 				addr_size = sizeof(struct in6_addr);
 				addr_ptr = (caddr_t)&((struct sockaddr_in6 *)
 				    found_addr)->sin6_addr;
-			} else {
+				break;
+#endif
+#ifdef INET
+			case AF_INET:
 				/* copy IPv4 address */
 				lookup->ph.param_type =
 				    htons(SCTP_IPV4_ADDRESS);
@@ -2713,6 +2802,13 @@ sctp_compose_asconf(struct sctp_tcb *stc
 				addr_size = sizeof(struct in_addr);
 				addr_ptr = (caddr_t)&((struct sockaddr_in *)
 				    found_addr)->sin_addr;
+				break;
+#endif
+			default:
+				p_size = 0;
+				addr_size = 0;
+				addr_ptr = NULL;
+				break;
 			}
 			lookup->ph.param_length = htons(SCTP_SIZE32(p_size));
 			memcpy(lookup->addr, addr_ptr, addr_size);
@@ -2722,7 +2818,7 @@ sctp_compose_asconf(struct sctp_tcb *stc
 			/* uh oh... don't have any address?? */
 			SCTPDBG(SCTP_DEBUG_ASCONF1,
 			    "compose_asconf: no lookup addr!\n");
-			/* for now, we send a IPv4 address of 0.0.0.0 */
+			/* XXX for now, we send a IPv4 address of 0.0.0.0 */
 			lookup->ph.param_type = htons(SCTP_IPV4_ADDRESS);
 			lookup->ph.param_length = htons(SCTP_SIZE32(sizeof(struct sctp_ipv4addr_param)));
 			bzero(lookup->addr, sizeof(struct in_addr));
@@ -2754,8 +2850,15 @@ sctp_process_initack_addresses(struct sc
 	uint16_t plen, ptype;
 	struct sctp_ifa *sctp_ifa;
 	struct sctp_ipv6addr_param addr_store;
+
+#ifdef INET6
 	struct sockaddr_in6 sin6;
+
+#endif
+#ifdef INET
 	struct sockaddr_in sin;
+
+#endif

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:21:29 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6EF89106566C;
	Sat, 30 Apr 2011 11:21:29 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D8998FC16;
	Sat, 30 Apr 2011 11:21:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBLTeC043453;
	Sat, 30 Apr 2011 11:21:29 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBLTBX043445;
	Sat, 30 Apr 2011 11:21:29 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301121.p3UBLTBX043445@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 11:21:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221250 - in head/sys: conf netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:21:29 -0000

Author: bz
Date: Sat Apr 30 11:21:29 2011
New Revision: 221250
URL: http://svn.freebsd.org/changeset/base/221250

Log:
  Make the TCP code compile without INET.  Sort #includes and add #ifdef INETs.
  Add some comments at #endifs given more nestedness.  To make the compiler
  happy, some default initializations were added in accordance with the style
  on the files.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/conf/files
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_syncache.c
  head/sys/netinet/tcp_timewait.c
  head/sys/netinet/tcp_usrreq.c

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/conf/files	Sat Apr 30 11:21:29 2011	(r221250)
@@ -2740,8 +2740,8 @@ netinet/ip_mroute.c		optional mrouting i
 netinet/ip_options.c		optional inet
 netinet/ip_output.c		optional inet
 netinet/raw_ip.c		optional inet
-netinet/cc/cc.c			optional inet
-netinet/cc/cc_newreno.c		optional inet
+netinet/cc/cc.c			optional inet | inet6
+netinet/cc/cc_newreno.c		optional inet | inet6
 netinet/sctp_asconf.c		optional inet sctp
 netinet/sctp_auth.c		optional inet sctp
 netinet/sctp_bsd_addr.c		optional inet sctp
@@ -2758,18 +2758,18 @@ netinet/sctp_timer.c		optional inet sctp
 netinet/sctp_usrreq.c		optional inet sctp
 netinet/sctputil.c		optional inet sctp
 netinet/tcp_debug.c		optional tcpdebug
-netinet/tcp_hostcache.c		optional inet
-netinet/tcp_input.c		optional inet
-netinet/tcp_lro.c		optional inet
-netinet/tcp_output.c		optional inet
-netinet/tcp_offload.c		optional inet
-netinet/tcp_reass.c		optional inet
-netinet/tcp_sack.c		optional inet
-netinet/tcp_subr.c		optional inet
-netinet/tcp_syncache.c		optional inet
-netinet/tcp_timer.c		optional inet
-netinet/tcp_timewait.c		optional inet
-netinet/tcp_usrreq.c		optional inet
+netinet/tcp_hostcache.c		optional inet | inet6
+netinet/tcp_input.c		optional inet | inet6
+netinet/tcp_lro.c		optional inet | inet6
+netinet/tcp_output.c		optional inet | inet6
+netinet/tcp_offload.c		optional inet | inet6
+netinet/tcp_reass.c		optional inet | inet6
+netinet/tcp_sack.c		optional inet | inet6
+netinet/tcp_subr.c		optional inet | inet6
+netinet/tcp_syncache.c		optional inet | inet6
+netinet/tcp_timer.c		optional inet | inet6
+netinet/tcp_timewait.c		optional inet | inet6
+netinet/tcp_usrreq.c		optional inet | inet6
 netinet/udp_usrreq.c		optional inet | inet6
 netinet/libalias/alias.c	optional libalias inet | netgraph_nat inet
 netinet/libalias/alias_db.c	optional libalias inet | netgraph_nat inet

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/netinet/tcp_input.c	Sat Apr 30 11:21:29 2011	(r221250)
@@ -367,12 +367,13 @@ cc_conn_init(struct tcpcb *tp)
 		tp->snd_cwnd = min(4 * tp->t_maxseg,
 		    max(2 * tp->t_maxseg, 4380));
 #ifdef INET6
-	else if ((isipv6 && in6_localaddr(&inp->in6p_faddr)) ||
-		 (!isipv6 && in_localaddr(inp->inp_faddr)))
-#else
-	else if (in_localaddr(inp->inp_faddr))
+	else if (isipv6 && in6_localaddr(&inp->in6p_faddr))
+		tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local;
 #endif
+#if defined(INET) || defined(INET6)
+	else if (in_localaddr(inp->inp_faddr))
 		tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local;
+#endif
 	else
 		tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz;
 
@@ -542,37 +543,46 @@ tcp6_input(struct mbuf **mp, int *offp, 
 	tcp_input(m, *offp);
 	return IPPROTO_DONE;
 }
-#endif
+#endif /* INET6 */
 
 void
 tcp_input(struct mbuf *m, int off0)
 {
-	struct tcphdr *th;
+	struct tcphdr *th = NULL;
 	struct ip *ip = NULL;
+#ifdef INET
 	struct ipovly *ipov;
+#endif
 	struct inpcb *inp = NULL;
 	struct tcpcb *tp = NULL;
 	struct socket *so = NULL;
 	u_char *optp = NULL;
 	int optlen = 0;
-	int len, tlen, off;
+#ifdef INET
+	int len;
+#endif
+	int tlen = 0, off;
 	int drop_hdrlen;
 	int thflags;
 	int rstreason = 0;	/* For badport_bandlim accounting purposes */
-	uint8_t iptos;
 #ifdef TCP_SIGNATURE
 	uint8_t sig_checked = 0;
 #endif
+	uint8_t iptos = 0;
+#ifdef INET
 #ifdef IPFIREWALL_FORWARD
 	struct m_tag *fwd_tag;
 #endif
+#endif /* INET */
 #ifdef INET6
 	struct ip6_hdr *ip6 = NULL;
 	int isipv6;
 #else
 	const void *ip6 = NULL;
+#if (defined(INET) && defined(IPFIREWALL_FORWARD)) || defined(TCPDEBUG)
 	const int isipv6 = 0;
 #endif
+#endif /* INET6 */
 	struct tcpopt to;		/* options in this segment */
 	char *s = NULL;			/* address and port logging */
 	int ti_locked;
@@ -597,8 +607,8 @@ tcp_input(struct mbuf *m, int off0)
 	to.to_flags = 0;
 	TCPSTAT_INC(tcps_rcvtotal);
 
-	if (isipv6) {
 #ifdef INET6
+	if (isipv6) {
 		/* IP6_EXTHDR_CHECK() is already done at tcp6_input(). */
 		ip6 = mtod(m, struct ip6_hdr *);
 		tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0;
@@ -620,10 +630,13 @@ tcp_input(struct mbuf *m, int off0)
 			/* XXX stat */
 			goto drop;
 		}
-#else
-		th = NULL;		/* XXX: Avoid compiler warning. */
+	}
 #endif
-	} else {
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
+	{
 		/*
 		 * Get IP and TCP header together in first mbuf.
 		 * Note: IP leaves IP header in first mbuf.
@@ -675,13 +688,18 @@ tcp_input(struct mbuf *m, int off0)
 		/* Re-initialization for later version check */
 		ip->ip_v = IPVERSION;
 	}
+#endif /* INET */
 
 #ifdef INET6
 	if (isipv6)
 		iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
+#endif
+#if defined(INET) && defined(INET6)
 	else
 #endif
+#ifdef INET
 		iptos = ip->ip_tos;
+#endif
 
 	/*
 	 * Check that TCP offset makes sense,
@@ -694,13 +712,18 @@ tcp_input(struct mbuf *m, int off0)
 	}
 	tlen -= off;	/* tlen is used instead of ti->ti_len */
 	if (off > sizeof (struct tcphdr)) {
-		if (isipv6) {
 #ifdef INET6
+		if (isipv6) {
 			IP6_EXTHDR_CHECK(m, off0, off, );
 			ip6 = mtod(m, struct ip6_hdr *);
 			th = (struct tcphdr *)((caddr_t)ip6 + off0);
+		}
 #endif
-		} else {
+#if defined(INET) && defined(INET6)
+		else
+#endif
+#ifdef INET
+		{
 			if (m->m_len < sizeof(struct ip) + off) {
 				if ((m = m_pullup(m, sizeof (struct ip) + off))
 				    == NULL) {
@@ -712,6 +735,7 @@ tcp_input(struct mbuf *m, int off0)
 				th = (struct tcphdr *)((caddr_t)ip + off0);
 			}
 		}
+#endif
 		optlen = off - sizeof (struct tcphdr);
 		optp = (u_char *)(th + 1);
 	}
@@ -754,6 +778,7 @@ findpcb:
 		panic("%s: findpcb ti_locked %d\n", __func__, ti_locked);
 #endif
 
+#ifdef INET
 #ifdef IPFIREWALL_FORWARD
 	/*
 	 * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
@@ -787,21 +812,26 @@ findpcb:
 		m_tag_delete(m, fwd_tag);
 	} else
 #endif /* IPFIREWALL_FORWARD */
+#endif /* INET */
 	{
-		if (isipv6) {
 #ifdef INET6
+		if (isipv6)
 			inp = in6_pcblookup_hash(&V_tcbinfo,
 						 &ip6->ip6_src, th->th_sport,
 						 &ip6->ip6_dst, th->th_dport,
 						 INPLOOKUP_WILDCARD,
 						 m->m_pkthdr.rcvif);
 #endif
-		} else
+#if defined(INET) && defined(INET6)
+		else
+#endif
+#ifdef INET
 			inp = in_pcblookup_hash(&V_tcbinfo,
 						ip->ip_src, th->th_sport,
 						ip->ip_dst, th->th_dport,
 						INPLOOKUP_WILDCARD,
 						m->m_pkthdr.rcvif);
+#endif
 	}
 
 	/*
@@ -989,7 +1019,7 @@ relocked:
 			bcopy((char *)ip, (char *)tcp_saveipgen, sizeof(*ip));
 		tcp_savetcp = *th;
 	}
-#endif
+#endif /* TCPDEBUG */
 	/*
 	 * When the socket is accepting connections (the INPCB is in LISTEN
 	 * state) we look into the SYN cache if this is a new connection
@@ -1224,7 +1254,7 @@ relocked:
 			}
 			ifa_free(&ia6->ia_ifa);
 		}
-#endif
+#endif /* INET6 */
 		/*
 		 * Basic sanity checks on incoming SYN requests:
 		 *   Don't respond if the destination is a link layer
@@ -1243,8 +1273,8 @@ relocked:
 				"link layer address ignored\n", s, __func__);
 			goto dropunlock;
 		}
-		if (isipv6) {
 #ifdef INET6
+		if (isipv6) {
 			if (th->th_dport == th->th_sport &&
 			    IN6_ARE_ADDR_EQUAL(&ip6->ip6_dst, &ip6->ip6_src)) {
 				if ((s = tcp_log_addrs(&inc, th, NULL, NULL)))
@@ -1261,8 +1291,13 @@ relocked:
 					"address ignored\n", s, __func__);
 				goto dropunlock;
 			}
+		}
 #endif
-		} else {
+#if defined(INET) && defined(INET6)
+		else
+#endif
+#ifdef INET
+		{
 			if (th->th_dport == th->th_sport &&
 			    ip->ip_dst.s_addr == ip->ip_src.s_addr) {
 				if ((s = tcp_log_addrs(&inc, th, NULL, NULL)))
@@ -1283,6 +1318,7 @@ relocked:
 				goto dropunlock;
 			}
 		}
+#endif
 		/*
 		 * SYN appears to be valid.  Create compressed TCP state
 		 * for syncache.
@@ -3020,7 +3056,9 @@ static void
 tcp_dropwithreset(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp,
     int tlen, int rstreason)
 {
+#ifdef INET
 	struct ip *ip;
+#endif
 #ifdef INET6
 	struct ip6_hdr *ip6;
 #endif
@@ -3039,8 +3077,12 @@ tcp_dropwithreset(struct mbuf *m, struct
 		    IN6_IS_ADDR_MULTICAST(&ip6->ip6_src))
 			goto drop;
 		/* IPv6 anycast check is done at tcp6_input() */
-	} else
+	}
 #endif
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
 	{
 		ip = mtod(m, struct ip *);
 		if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) ||
@@ -3049,6 +3091,7 @@ tcp_dropwithreset(struct mbuf *m, struct
 		    in_broadcast(ip->ip_dst, m->m_pkthdr.rcvif))
 			goto drop;
 	}
+#endif
 
 	/* Perform bandwidth limiting. */
 	if (badport_bandlim(rstreason) < 0)
@@ -3308,8 +3351,8 @@ void
 tcp_mss_update(struct tcpcb *tp, int offer,
     struct hc_metrics_lite *metricptr, int *mtuflags)
 {
-	int mss;
-	u_long maxmtu;
+	int mss = 0;
+	u_long maxmtu = 0;
 	struct inpcb *inp = tp->t_inpcb;
 	struct hc_metrics_lite metrics;
 	int origoffer = offer;
@@ -3329,12 +3372,17 @@ tcp_mss_update(struct tcpcb *tp, int off
 	if (isipv6) {
 		maxmtu = tcp_maxmtu6(&inp->inp_inc, mtuflags);
 		tp->t_maxopd = tp->t_maxseg = V_tcp_v6mssdflt;
-	} else
+	}
 #endif
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
 	{
 		maxmtu = tcp_maxmtu(&inp->inp_inc, mtuflags);
 		tp->t_maxopd = tp->t_maxseg = V_tcp_mssdflt;
 	}
+#endif
 
 	/*
 	 * No route to sender, stay with default mss and return.
@@ -3395,14 +3443,19 @@ tcp_mss_update(struct tcpcb *tp, int off
 			if (!V_path_mtu_discovery &&
 			    !in6_localaddr(&inp->in6p_faddr))
 				mss = min(mss, V_tcp_v6mssdflt);
-		} else
+		}
 #endif
+#if defined(INET) && defined(INET6)
+		else
+#endif
+#ifdef INET
 		{
 			mss = maxmtu - min_protoh;
 			if (!V_path_mtu_discovery &&
 			    !in_localaddr(inp->inp_faddr))
 				mss = min(mss, V_tcp_mssdflt);
 		}
+#endif
 		/*
 		 * XXX - The above conditional (mss = maxmtu - min_protoh)
 		 * probably violates the TCP spec.
@@ -3540,14 +3593,19 @@ tcp_mssopt(struct in_conninfo *inc)
 		maxmtu = tcp_maxmtu6(inc, NULL);
 		thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
 		min_protoh = sizeof(struct ip6_hdr) + sizeof(struct tcphdr);
-	} else
+	}
+#endif
+#if defined(INET) && defined(INET6)
+	else
 #endif
+#ifdef INET
 	{
 		mss = V_tcp_mssdflt;
 		maxmtu = tcp_maxmtu(inc, NULL);
 		thcmtu = tcp_hc_getmtu(inc); /* IPv4 and IPv6 */
 		min_protoh = sizeof(struct tcpiphdr);
 	}
+#endif
 	if (maxmtu && thcmtu)
 		mss = min(maxmtu, thcmtu) - min_protoh;
 	else if (maxmtu || thcmtu)

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/netinet/tcp_output.c	Sat Apr 30 11:21:29 2011	(r221250)
@@ -173,7 +173,7 @@ tcp_output(struct tcpcb *tp)
 {
 	struct socket *so = tp->t_inpcb->inp_socket;
 	long len, recwin, sendwin;
-	int off, flags, error;
+	int off, flags, error = 0;	/* Keep compiler happy */
 	struct mbuf *m;
 	struct ip *ip = NULL;
 	struct ipovly *ipov = NULL;
@@ -659,7 +659,7 @@ send:
 		hdrlen = sizeof (struct ip6_hdr) + sizeof (struct tcphdr);
 	else
 #endif
-	hdrlen = sizeof (struct tcpiphdr);
+		hdrlen = sizeof (struct tcpiphdr);
 
 	/*
 	 * Compute options for segment.
@@ -866,7 +866,7 @@ send:
 				goto out;
 			}
 		}
-#endif
+#endif /* notyet */
 		/*
 		 * If we're sending everything we've got, set PUSH.
 		 * (This will keep happy those implementations which only
@@ -1189,7 +1189,7 @@ timer:
 #endif
 		ipov->ih_len = save;
 	}
-#endif
+#endif /* TCPDEBUG */
 
 	/*
 	 * Fill in IP length and desired time to live and
@@ -1216,8 +1216,12 @@ timer:
 			    tp->t_inpcb->in6p_outputopts, NULL,
 			    ((so->so_options & SO_DONTROUTE) ?
 			    IP_ROUTETOIF : 0), NULL, NULL, tp->t_inpcb);
-	} else
+	}
 #endif /* INET6 */
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
     {
 	ip->ip_len = m->m_pkthdr.len;
 #ifdef INET6
@@ -1239,6 +1243,7 @@ timer:
 	    ((so->so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0), 0,
 	    tp->t_inpcb);
     }
+#endif /* INET */
 	if (error) {
 
 		/*

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/netinet/tcp_subr.c	Sat Apr 30 11:21:29 2011	(r221250)
@@ -66,23 +66,20 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #ifdef INET6
 #include 
-#endif
-#include 
-#ifdef INET6
 #include 
-#endif
-#include 
-#include 
-#ifdef INET6
 #include 
 #include 
 #include 
 #endif
-#include 
+
 #include 
 #include 
 #include 
@@ -96,7 +93,9 @@ __FBSDID("$FreeBSD$");
 #ifdef TCPDEBUG
 #include 
 #endif
+#ifdef INET6
 #include 
+#endif
 
 #ifdef IPSEC
 #include 
@@ -160,7 +159,7 @@ SYSCTL_VNET_PROC(_net_inet_tcp, TCPCTL_V
     CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(tcp_v6mssdflt), 0,
     &sysctl_net_inet_tcp_mss_v6_check, "I",
    "Default TCP Maximum Segment Size for IPv6");
-#endif
+#endif /* INET6 */
 
 /*
  * Minimum MSS we accept and use. This prevents DoS attacks where
@@ -414,8 +413,12 @@ tcpip_fillheaders(struct inpcb *inp, voi
 		ip6->ip6_plen = htons(sizeof(struct tcphdr));
 		ip6->ip6_src = inp->in6p_laddr;
 		ip6->ip6_dst = inp->in6p_faddr;
-	} else
+	}
+#endif /* INET6 */
+#if defined(INET6) && defined(INET)
+	else
 #endif
+#ifdef INET
 	{
 		struct ip *ip;
 
@@ -432,6 +435,7 @@ tcpip_fillheaders(struct inpcb *inp, voi
 		ip->ip_src = inp->inp_laddr;
 		ip->ip_dst = inp->inp_faddr;
 	}
+#endif /* INET */
 	th->th_sport = inp->inp_lport;
 	th->th_dport = inp->inp_fport;
 	th->th_seq = 0;
@@ -493,7 +497,7 @@ tcp_respond(struct tcpcb *tp, void *ipge
 	KASSERT(tp != NULL || m != NULL, ("tcp_respond: tp and m both NULL"));
 
 #ifdef INET6
-	isipv6 = ((struct ip *)ipgen)->ip_v == 6;
+	isipv6 = ((struct ip *)ipgen)->ip_v == (IPV6_VERSION >> 4);
 	ip6 = ipgen;
 #endif /* INET6 */
 	ip = ipgen;
@@ -574,8 +578,12 @@ tcp_respond(struct tcpcb *tp, void *ipge
 		ip6->ip6_plen = htons((u_short)(sizeof (struct tcphdr) +
 						tlen));
 		tlen += sizeof (struct ip6_hdr) + sizeof (struct tcphdr);
-	} else
+	}
 #endif
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
 	{
 		tlen += sizeof (struct tcpiphdr);
 		ip->ip_len = tlen;
@@ -583,6 +591,7 @@ tcp_respond(struct tcpcb *tp, void *ipge
 		if (V_path_mtu_discovery)
 			ip->ip_off |= IP_DF;
 	}
+#endif
 	m->m_len = tlen;
 	m->m_pkthdr.len = tlen;
 	m->m_pkthdr.rcvif = NULL;
@@ -620,14 +629,19 @@ tcp_respond(struct tcpcb *tp, void *ipge
 					tlen - sizeof(struct ip6_hdr));
 		ip6->ip6_hlim = in6_selecthlim(tp != NULL ? tp->t_inpcb :
 		    NULL, NULL);
-	} else
+	}
 #endif /* INET6 */
+#if defined(INET6) && defined(INET)
+	else
+#endif
+#ifdef INET
 	{
 		nth->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
 		    htons((u_short)(tlen - sizeof(struct ip) + ip->ip_p)));
 		m->m_pkthdr.csum_flags = CSUM_TCP;
 		m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
 	}
+#endif /* INET */
 #ifdef TCPDEBUG
 	if (tp == NULL || (inp->inp_socket->so_options & SO_DEBUG))
 		tcp_trace(TA_OUTPUT, 0, tp, mtod(m, void *), th, 0);
@@ -635,9 +649,13 @@ tcp_respond(struct tcpcb *tp, void *ipge
 #ifdef INET6
 	if (isipv6)
 		(void) ip6_output(m, NULL, NULL, ipflags, NULL, NULL, inp);
-	else
 #endif /* INET6 */
-	(void) ip_output(m, NULL, NULL, ipflags, NULL, inp);
+#if defined(INET) && defined(INET6)
+	else
+#endif
+#ifdef INET
+		(void) ip_output(m, NULL, NULL, ipflags, NULL, inp);
+#endif
 }
 
 /*
@@ -1200,6 +1218,7 @@ SYSCTL_PROC(_net_inet_tcp, TCPCTL_PCBLIS
     CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0,
     tcp_pcblist, "S,xtcpcb", "List of active TCP connections");
 
+#ifdef INET
 static int
 tcp_getcred(SYSCTL_HANDLER_ARGS)
 {
@@ -1239,6 +1258,7 @@ tcp_getcred(SYSCTL_HANDLER_ARGS)
 SYSCTL_PROC(_net_inet_tcp, OID_AUTO, getcred,
     CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0,
     tcp_getcred, "S,xucred", "Get the xucred of a TCP connection");
+#endif /* INET */
 
 #ifdef INET6
 static int
@@ -1247,7 +1267,10 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
 	struct xucred xuc;
 	struct sockaddr_in6 addrs[2];
 	struct inpcb *inp;
-	int error, mapped = 0;
+	int error;
+#ifdef INET
+	int mapped = 0;
+#endif
 
 	error = priv_check(req->td, PRIV_NETINET_GETCRED);
 	if (error)
@@ -1260,13 +1283,16 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
 		return (error);
 	}
 	if (IN6_IS_ADDR_V4MAPPED(&addrs[0].sin6_addr)) {
+#ifdef INET
 		if (IN6_IS_ADDR_V4MAPPED(&addrs[1].sin6_addr))
 			mapped = 1;
 		else
+#endif
 			return (EINVAL);
 	}
 
 	INP_INFO_RLOCK(&V_tcbinfo);
+#ifdef INET
 	if (mapped == 1)
 		inp = in_pcblookup_hash(&V_tcbinfo,
 			*(struct in_addr *)&addrs[1].sin6_addr.s6_addr[12],
@@ -1275,6 +1301,7 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
 			addrs[0].sin6_port,
 			0, NULL);
 	else
+#endif
 		inp = in6_pcblookup_hash(&V_tcbinfo,
 			&addrs[1].sin6_addr, addrs[1].sin6_port,
 			&addrs[0].sin6_addr, addrs[0].sin6_port, 0, NULL);
@@ -1300,9 +1327,10 @@ tcp6_getcred(SYSCTL_HANDLER_ARGS)
 SYSCTL_PROC(_net_inet6_tcp6, OID_AUTO, getcred,
     CTLTYPE_OPAQUE|CTLFLAG_RW|CTLFLAG_PRISON, 0, 0,
     tcp6_getcred, "S,xucred", "Get the xucred of a TCP6 connection");
-#endif
+#endif /* INET6 */
 
 
+#ifdef INET
 void
 tcp_ctlinput(int cmd, struct sockaddr *sa, void *vip)
 {
@@ -1415,6 +1443,7 @@ tcp_ctlinput(int cmd, struct sockaddr *s
 	} else
 		in_pcbnotifyall(&V_tcbinfo, faddr, inetctlerrmap[cmd], notify);
 }
+#endif /* INET */
 
 #ifdef INET6
 void
@@ -1694,6 +1723,7 @@ tcp_mtudisc(struct inpcb *inp, int errno
 	return (inp);
 }
 
+#ifdef INET
 /*
  * Look-up the routing entry to the peer of this inpcb.  If no route
  * is found and it cannot be allocated, then return 0.  This routine
@@ -1735,6 +1765,7 @@ tcp_maxmtu(struct in_conninfo *inc, int 
 	}
 	return (maxmtu);
 }
+#endif /* INET */
 
 #ifdef INET6
 u_long
@@ -1858,11 +1889,15 @@ tcp_signature_compute(struct mbuf *m, in
     u_char *buf, u_int direction)
 {
 	union sockaddr_union dst;
+#ifdef INET
 	struct ippseudo ippseudo;
+#endif
 	MD5_CTX ctx;
 	int doff;
 	struct ip *ip;
+#ifdef INET
 	struct ipovly *ipovly;
+#endif
 	struct secasvar *sav;
 	struct tcphdr *th;
 #ifdef INET6
@@ -1884,12 +1919,14 @@ tcp_signature_compute(struct mbuf *m, in
 	ip6 = NULL;	/* Make the compiler happy. */
 #endif
 	switch (ip->ip_v) {
+#ifdef INET
 	case IPVERSION:
 		dst.sa.sa_len = sizeof(struct sockaddr_in);
 		dst.sa.sa_family = AF_INET;
 		dst.sin.sin_addr = (direction == IPSEC_DIR_INBOUND) ?
 		    ip->ip_src : ip->ip_dst;
 		break;
+#endif
 #ifdef INET6
 	case (IPV6_VERSION >> 4):
 		ip6 = mtod(m, struct ip6_hdr *);
@@ -1929,6 +1966,7 @@ tcp_signature_compute(struct mbuf *m, in
 	 * tcp_output(), the underlying ip_len member has not yet been set.
 	 */
 	switch (ip->ip_v) {
+#ifdef INET
 	case IPVERSION:
 		ipovly = (struct ipovly *)ip;
 		ippseudo.ippseudo_src = ipovly->ih_src;
@@ -1942,6 +1980,7 @@ tcp_signature_compute(struct mbuf *m, in
 		th = (struct tcphdr *)((u_char *)ip + sizeof(struct ip));
 		doff = sizeof(struct ip) + sizeof(struct tcphdr) + optlen;
 		break;
+#endif
 #ifdef INET6
 	/*
 	 * RFC 2385, 2.0  Proposal
@@ -2122,6 +2161,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
 			return (error);
 		break;
 #endif
+#ifdef INET
 	case AF_INET:
 		fin = (struct sockaddr_in *)&addrs[0];
 		lin = (struct sockaddr_in *)&addrs[1];
@@ -2129,6 +2169,7 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
 		    lin->sin_len != sizeof(struct sockaddr_in))
 			return (EINVAL);
 		break;
+#endif
 	default:
 		return (EINVAL);
 	}
@@ -2141,10 +2182,12 @@ sysctl_drop(SYSCTL_HANDLER_ARGS)
 		    NULL);
 		break;
 #endif
+#ifdef INET
 	case AF_INET:
 		inp = in_pcblookup_hash(&V_tcbinfo, fin->sin_addr,
 		    fin->sin_port, lin->sin_addr, lin->sin_port, 0, NULL);
 		break;
+#endif
 	}
 	if (inp != NULL) {
 		INP_WLOCK(inp);
@@ -2272,6 +2315,7 @@ tcp_log_addr(struct in_conninfo *inc, st
 		sp = s + strlen(s);
 		sprintf(sp, "]:%i", ntohs(th->th_dport));
 #endif /* INET6 */
+#ifdef INET
 	} else if (ip && th) {
 		inet_ntoa_r(ip->ip_src, sp);
 		sp = s + strlen(s);
@@ -2280,6 +2324,7 @@ tcp_log_addr(struct in_conninfo *inc, st
 		inet_ntoa_r(ip->ip_dst, sp);
 		sp = s + strlen(s);
 		sprintf(sp, "]:%i", ntohs(th->th_dport));
+#endif /* INET */
 	} else {
 		free(s, M_TCPLOG);
 		return (NULL);

Modified: head/sys/netinet/tcp_syncache.c
==============================================================================
--- head/sys/netinet/tcp_syncache.c	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/netinet/tcp_syncache.c	Sat Apr 30 11:21:29 2011	(r221250)
@@ -742,8 +742,12 @@ syncache_socket(struct syncache *sc, str
 		/* Override flowlabel from in6_pcbconnect. */
 		inp->inp_flow &= ~IPV6_FLOWLABEL_MASK;
 		inp->inp_flow |= sc->sc_flowlabel;
-	} else
+	}
+#endif /* INET6 */
+#if defined(INET) && defined(INET6)
+	else
 #endif
+#ifdef INET
 	{
 		struct in_addr laddr;
 		struct sockaddr_in sin;
@@ -775,6 +779,7 @@ syncache_socket(struct syncache *sc, str
 			goto abort;
 		}
 	}
+#endif /* INET */
 	tp = intotcpcb(inp);
 	tp->t_state = TCPS_SYN_RECEIVED;
 	tp->iss = sc->sc_iss;
@@ -1067,7 +1072,11 @@ _syncache_add(struct in_conninfo *inc, s
 #ifdef INET6
 	if (!(inc->inc_flags & INC_ISIPV6))
 #endif
+#ifdef INET
 		ipopts = (m) ? ip_srcroute(m) : NULL;
+#else
+		ipopts = NULL;
+#endif
 
 	/*
 	 * See if we already have an entry for this connection.
@@ -1301,8 +1310,8 @@ syncache_respond(struct syncache *sc)
 {
 	struct ip *ip = NULL;
 	struct mbuf *m;
-	struct tcphdr *th;
-	int optlen, error;
+	struct tcphdr *th = NULL;
+	int optlen, error = 0;	/* Make compiler happy */
 	u_int16_t hlen, tlen, mssopt;
 	struct tcpopt to;
 #ifdef INET6
@@ -1350,8 +1359,12 @@ syncache_respond(struct syncache *sc)
 		ip6->ip6_flow |= sc->sc_flowlabel;
 
 		th = (struct tcphdr *)(ip6 + 1);
-	} else
+	}
 #endif
+#if defined(INET6) && defined(INET)
+	else
+#endif
+#ifdef INET
 	{
 		ip = mtod(m, struct ip *);
 		ip->ip_v = IPVERSION;
@@ -1378,6 +1391,7 @@ syncache_respond(struct syncache *sc)
 
 		th = (struct tcphdr *)(ip + 1);
 	}
+#endif /* INET */
 	th->th_sport = sc->sc_inc.inc_lport;
 	th->th_dport = sc->sc_inc.inc_fport;
 
@@ -1445,8 +1459,12 @@ syncache_respond(struct syncache *sc)
 				       tlen + optlen - hlen);
 		ip6->ip6_hlim = in6_selecthlim(NULL, NULL);
 		error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL);
-	} else
+	}
 #endif
+#if defined(INET6) && defined(INET)
+	else
+#endif
+#ifdef INET
 	{
 		th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
 		    htons(tlen + optlen - hlen + IPPROTO_TCP));
@@ -1454,6 +1472,7 @@ syncache_respond(struct syncache *sc)
 		m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
 		error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL);
 	}
+#endif
 	return (error);
 }
 

Modified: head/sys/netinet/tcp_timewait.c
==============================================================================
--- head/sys/netinet/tcp_timewait.c	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/netinet/tcp_timewait.c	Sat Apr 30 11:21:29 2011	(r221250)
@@ -57,23 +57,19 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
+#include 
 #include 
+#include 
+#include 
 #ifdef INET6
 #include 
-#endif
-#include 
-#ifdef INET6
 #include 
-#endif
-#include 
-#include 
-#ifdef INET6
 #include 
 #include 
 #include 
 #endif
-#include 
 #include 
 #include 
 #include 
@@ -86,7 +82,9 @@ __FBSDID("$FreeBSD$");
 #ifdef TCPDEBUG
 #include 
 #endif
+#ifdef INET6
 #include 
+#endif
 
 #include 
 
@@ -202,15 +200,31 @@ tcp_twstart(struct tcpcb *tp)
 	struct inpcb *inp = tp->t_inpcb;
 	int acknow;
 	struct socket *so;
+#ifdef INET6
+	int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6;
+#endif
 
 	INP_INFO_WLOCK_ASSERT(&V_tcbinfo);	/* tcp_tw_2msl_reset(). */
 	INP_WLOCK_ASSERT(inp);
 
-	if (V_nolocaltimewait && in_localip(inp->inp_faddr)) {
-		tp = tcp_close(tp);
-		if (tp != NULL)
-			INP_WUNLOCK(inp);
-		return;
+	if (V_nolocaltimewait) {
+		int error = 0;
+#ifdef INET6
+		if (isipv6)
+			error = in6_localaddr(&inp->in6p_faddr);
+#endif
+#if defined(INET6) && defined(INET)
+		else
+#endif
+#ifdef INET
+			error = in_localip(inp->inp_faddr);
+#endif
+		if (error) {
+			tp = tcp_close(tp);
+			if (tp != NULL)
+				INP_WUNLOCK(inp);
+			return;
+		}
 	}
 
 	tw = uma_zalloc(V_tcptw_zone, M_NOWAIT);
@@ -488,11 +502,15 @@ int
 tcp_twrespond(struct tcptw *tw, int flags)
 {
 	struct inpcb *inp = tw->tw_inpcb;
-	struct tcphdr *th;
+#if defined(INET6) || defined(INET)
+	struct tcphdr *th = NULL;
+#endif
 	struct mbuf *m;
+#ifdef INET
 	struct ip *ip = NULL;
+#endif
 	u_int hdrlen, optlen;
-	int error;
+	int error = 0;			/* Keep compiler happy */
 	struct tcpopt to;
 #ifdef INET6
 	struct ip6_hdr *ip6 = NULL;
@@ -516,14 +534,19 @@ tcp_twrespond(struct tcptw *tw, int flag
 		ip6 = mtod(m, struct ip6_hdr *);
 		th = (struct tcphdr *)(ip6 + 1);
 		tcpip_fillheaders(inp, ip6, th);
-	} else
+	}
 #endif
+#if defined(INET6) && defined(INET)
+	else
+#endif
+#ifdef INET
 	{
 		hdrlen = sizeof(struct tcpiphdr);
 		ip = mtod(m, struct ip *);
 		th = (struct tcphdr *)(ip + 1);
 		tcpip_fillheaders(inp, ip, th);
 	}
+#endif
 	to.to_flags = 0;
 
 	/*
@@ -555,8 +578,12 @@ tcp_twrespond(struct tcptw *tw, int flag
 		ip6->ip6_hlim = in6_selecthlim(inp, NULL);
 		error = ip6_output(m, inp->in6p_outputopts, NULL,
 		    (tw->tw_so_options & SO_DONTROUTE), NULL, NULL, inp);
-	} else
+	}
 #endif
+#if defined(INET6) && defined(INET)
+	else
+#endif
+#ifdef INET
 	{
 		th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
 		    htons(sizeof(struct tcphdr) + optlen + IPPROTO_TCP));
@@ -569,6 +596,7 @@ tcp_twrespond(struct tcptw *tw, int flag
 		    ((tw->tw_so_options & SO_DONTROUTE) ? IP_ROUTETOIF : 0),
 		    NULL, inp);
 	}
+#endif
 	if (flags & TH_ACK)
 		TCPSTAT_INC(tcps_sndacks);
 	else

Modified: head/sys/netinet/tcp_usrreq.c
==============================================================================
--- head/sys/netinet/tcp_usrreq.c	Sat Apr 30 11:18:16 2011	(r221249)
+++ head/sys/netinet/tcp_usrreq.c	Sat Apr 30 11:21:29 2011	(r221250)
@@ -64,17 +64,13 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
-#ifdef INET6

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:22:30 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E111A1065680;
	Sat, 30 Apr 2011 11:22:30 +0000 (UTC)
	(envelope-from tuexen@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 960CB8FC22;
	Sat, 30 Apr 2011 11:22:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBMUIw043536;
	Sat, 30 Apr 2011 11:22:30 GMT (envelope-from tuexen@svn.freebsd.org)
Received: (from tuexen@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBMUdb043534;
	Sat, 30 Apr 2011 11:22:30 GMT (envelope-from tuexen@svn.freebsd.org)
Message-Id: <201104301122.p3UBMUdb043534@svn.freebsd.org>
From: Michael Tuexen 
Date: Sat, 30 Apr 2011 11:22:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221251 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:22:31 -0000

Author: tuexen
Date: Sat Apr 30 11:22:30 2011
New Revision: 221251
URL: http://svn.freebsd.org/changeset/base/221251

Log:
  Remove some leftover debug code.
  
  MFC after: 1 week

Modified:
  head/sys/netinet/sctp_os_bsd.h

Modified: head/sys/netinet/sctp_os_bsd.h
==============================================================================
--- head/sys/netinet/sctp_os_bsd.h	Sat Apr 30 11:21:29 2011	(r221250)
+++ head/sys/netinet/sctp_os_bsd.h	Sat Apr 30 11:22:30 2011	(r221251)
@@ -39,9 +39,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_ipsec.h"
 #include "opt_compat.h"
 #include "opt_inet6.h"
-#if 1
 #include "opt_inet.h"
-#endif
 #include "opt_sctp.h"
 
 #include 

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:28:22 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C0D9106566B;
	Sat, 30 Apr 2011 11:28:22 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4B9BB8FC16;
	Sat, 30 Apr 2011 11:28:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBSMvb043741;
	Sat, 30 Apr 2011 11:28:22 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBSMSv043738;
	Sat, 30 Apr 2011 11:28:22 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301128.p3UBSMSv043738@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 11:28:22 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221252 - in head/sys/mips: atheros conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:28:22 -0000

Author: adrian
Date: Sat Apr 30 11:28:21 2011
New Revision: 221252
URL: http://svn.freebsd.org/changeset/base/221252

Log:
  In preparation for the AR724x PCIe bus code, make the AR71xx PCI bus
  glue require 'device ar71xx_pci' .
  
  Users of the AR71xx board configs will now require this for functioning
  PCI:
  
  device pci
  device ar71xx_pci

Modified:
  head/sys/mips/atheros/files.ar71xx
  head/sys/mips/conf/AR71XX

Modified: head/sys/mips/atheros/files.ar71xx
==============================================================================
--- head/sys/mips/atheros/files.ar71xx	Sat Apr 30 11:22:30 2011	(r221251)
+++ head/sys/mips/atheros/files.ar71xx	Sat Apr 30 11:28:21 2011	(r221252)
@@ -5,7 +5,7 @@ mips/atheros/ar71xx_gpio.c	optional gpio
 mips/atheros/ar71xx_machdep.c	standard
 mips/atheros/ar71xx_ehci.c	optional ehci
 mips/atheros/ar71xx_ohci.c	optional ohci
-mips/atheros/ar71xx_pci.c	optional pci
+mips/atheros/ar71xx_pci.c	optional ar71xx_pci pci
 mips/atheros/ar71xx_pci_bus_space.c	optional pci
 mips/atheros/ar71xx_spi.c	optional ar71xx_spi
 mips/atheros/pcf2123_rtc.c	optional pcf2123_rtc ar71xx_spi

Modified: head/sys/mips/conf/AR71XX
==============================================================================
--- head/sys/mips/conf/AR71XX	Sat Apr 30 11:22:30 2011	(r221251)
+++ head/sys/mips/conf/AR71XX	Sat Apr 30 11:28:21 2011	(r221252)
@@ -45,6 +45,7 @@ options		BOOTP_COMPAT
 options		ROOTDEVNAME=\"nfs:192.168.10.1:/mnt/bsd\"
 
 device		pci
+device		ar71xx_pci
 
 # Wireless NIC cards
 options		IEEE80211_DEBUG

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:30:43 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 037C410656B8;
	Sat, 30 Apr 2011 11:30:43 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E79C58FC08;
	Sat, 30 Apr 2011 11:30:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBUgJS043851;
	Sat, 30 Apr 2011 11:30:42 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBUght043849;
	Sat, 30 Apr 2011 11:30:42 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301130.p3UBUght043849@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 11:30:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221253 - head
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:30:43 -0000

Author: adrian
Date: Sat Apr 30 11:30:42 2011
New Revision: 221253
URL: http://svn.freebsd.org/changeset/base/221253

Log:
  Add UPDATING entry for the AR71xx config changes

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Sat Apr 30 11:28:21 2011	(r221252)
+++ head/UPDATING	Sat Apr 30 11:30:42 2011	(r221253)
@@ -22,6 +22,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 9.
 	machines to maximize performance.  (To disable malloc debugging, run
 	ln -s aj /etc/malloc.conf.)
 
+20110430:
+	Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci'
+	into their kernel configurations along with 'device pci'.
+
 20110427:
 	The default NFS client is now the new NFS client, so fstype "newnfs"
 	is now "nfs" and the regular/old NFS client is now fstype "oldnfs".

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:36:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 73CC6106564A;
	Sat, 30 Apr 2011 11:36:16 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 61F798FC18;
	Sat, 30 Apr 2011 11:36:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBaGdk044053;
	Sat, 30 Apr 2011 11:36:16 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBaGNp044050;
	Sat, 30 Apr 2011 11:36:16 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301136.p3UBaGNp044050@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 11:36:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221254 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:36:16 -0000

Author: adrian
Date: Sat Apr 30 11:36:16 2011
New Revision: 221254
URL: http://svn.freebsd.org/changeset/base/221254

Log:
  Add some initial PCIe bridge support for the AR724x chipsets.
  
  This is reported to work on the AR7240 based Ubiquiti Rocket M5
  but I haven't tested it on that hardware. I also don't yet have
  it fully working on the AR7242 based development board here;
  probe/attach functions but the register space resource looks like
  the endian-ness is wrong (0x10000000 instead of 0x00001000).o
  
  Further digging will be required.
  
  Submitted by:	Luiz Otavio O Souza

Added:
  head/sys/mips/atheros/ar724x_pci.c   (contents, props changed)
Modified:
  head/sys/mips/atheros/ar724xreg.h
  head/sys/mips/atheros/files.ar71xx

Added: head/sys/mips/atheros/ar724x_pci.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar724x_pci.c	Sat Apr 30 11:36:16 2011	(r221254)
@@ -0,0 +1,613 @@
+/*-
+ * Copyright (c) 2009, Oleksandr Tymoshenko 
+ * Copyright (c) 2011, Luiz Otavio O Souza.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include "pcib_if.h"
+
+#include 
+#include 
+#include 
+#include 		/* XXX */
+#include 	/* XXX */
+
+#include 
+
+#define	AR724X_PCI_DEBUG
+#ifdef AR724X_PCI_DEBUG
+#define dprintf printf
+#else
+#define dprintf(x, arg...)
+#endif
+
+struct ar71xx_pci_softc {
+	device_t		sc_dev;
+
+	int			sc_busno;
+	struct rman		sc_mem_rman;
+	struct rman		sc_irq_rman;
+
+	struct intr_event	*sc_eventstab[AR71XX_PCI_NIRQS];	
+	mips_intrcnt_t		sc_intr_counter[AR71XX_PCI_NIRQS];	
+	struct resource		*sc_irq;
+	void			*sc_ih;
+};
+
+static int ar724x_pci_setup_intr(device_t, device_t, struct resource *, int, 
+		    driver_filter_t *, driver_intr_t *, void *, void **);
+static int ar724x_pci_teardown_intr(device_t, device_t, struct resource *,
+		    void *);
+static int ar724x_pci_intr(void *);
+
+static void
+ar724x_pci_write(uint32_t reg, uint32_t offset, uint32_t data, int bytes)
+{
+	uint32_t val, mask, shift;
+
+	/* Register access is 32-bit aligned */
+	shift = 8 * (offset & (bytes % 4));
+	if (bytes % 4)
+		mask = (1 << (bytes * 8)) - 1;
+	else
+		mask = 0xffffffff;
+
+	val = ATH_READ_REG(reg + (offset & ~3));
+	val &= ~(mask << shift);
+	val |= ((data & mask) << shift);
+	ATH_WRITE_REG(reg + (offset & ~3), val);
+
+	dprintf("%s: %#x/%#x addr=%#x, data=%#x(%#x), bytes=%d\n", __func__, 
+	    reg, reg + (offset & ~3), offset, data, val, bytes);
+}
+
+static uint32_t
+ar724x_pci_read_config(device_t dev, u_int bus, u_int slot, u_int func, 
+    u_int reg, int bytes)
+{
+	uint32_t cmd, data, shift, mask;
+
+	/* Register access is 32-bit aligned */
+	shift = (reg & 3) * 8;
+	if (shift)
+		mask = (1 << shift) - 1;
+	else
+		mask = 0xffffffff;
+
+	dprintf("%s: tag (%x, %x, %x) reg %d(%d)\n", __func__, bus, slot,
+	    func, reg, bytes);
+
+	if ((bus == 0) && (slot == 0) && (func == 0)) {
+		data = ATH_READ_REG(AR724X_PCI_CFG_BASE + (reg & ~3));
+		/*
+		 * WAR for BAR issue - We are unable to access the PCI device
+		 * space if we set the BAR with proper base address.
+		 */
+		if (reg == PCIR_BAR(0) && bytes == 4) {
+			cmd = (ar71xx_soc == AR71XX_SOC_AR7240) ?
+			    0xffff : 0x1000ffff;
+			ar724x_pci_write(AR724X_PCI_CFG_BASE, reg, cmd, bytes);
+		}
+	} else
+		data = -1;
+
+	/* Get request bytes from 32-bit word */
+	data = (data >> shift) & mask;
+
+	dprintf("%s: read 0x%x\n", __func__, data);
+
+	return (data);
+}
+
+static void
+ar724x_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func, 
+    u_int reg, uint32_t data, int bytes)
+{
+
+	dprintf("%s: tag (%x, %x, %x) reg %d(%d): %x\n", __func__, bus, slot, 
+	    func, reg, bytes, data);
+
+	if ((bus != 0) || (slot != 0) || (func != 0))
+		return;
+
+	ar724x_pci_write(AR724X_PCI_CFG_BASE, reg, data, bytes);
+	/*
+	 * WAR for BAR issue - We are unable to access the PCI device space
+	 * if we set the BAR with proper base address.
+	 * Force a flush here (at register writing).
+	 */
+	if (reg == PCIR_BAR(0) && bytes == 4)
+		(void)ar724x_pci_read_config(dev, bus, slot, func, reg, bytes);
+}
+
+static void 
+ar724x_pci_mask_irq(void *source)
+{
+	uint32_t reg;
+	unsigned int irq = (unsigned int)source;
+
+	/* XXX - Only one interrupt ? Only one device ? */
+	if (irq != AR71XX_PCI_IRQ_START)
+		return;
+
+	/* Update the interrupt mask reg */
+	reg = ATH_READ_REG(AR724X_PCI_INTR_MASK);
+	ATH_WRITE_REG(AR724X_PCI_INTR_MASK,
+	    reg & ~AR724X_PCI_INTR_DEV0);
+
+	/* Clear any pending interrupt */
+	reg = ATH_READ_REG(AR724X_PCI_INTR_STATUS);
+	ATH_WRITE_REG(AR724X_PCI_INTR_STATUS,
+	    reg | AR724X_PCI_INTR_DEV0);
+}
+
+static void 
+ar724x_pci_unmask_irq(void *source)
+{
+	uint32_t reg;
+	unsigned int irq = (unsigned int)source;
+
+	/* XXX */
+	if (irq != AR71XX_PCI_IRQ_START)
+		return;
+
+	/* Update the interrupt mask reg */
+	reg = ATH_READ_REG(AR724X_PCI_INTR_MASK);
+	ATH_WRITE_REG(AR724X_PCI_INTR_MASK,
+	    reg | AR724X_PCI_INTR_DEV0);
+}
+
+static int
+ar724x_pci_setup(device_t dev)
+{
+	uint32_t reg;
+
+	/* setup COMMAND register */
+	reg = PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN | PCIM_CMD_SERRESPEN |
+	    PCIM_CMD_BACKTOBACK | PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN;
+
+	ar724x_pci_write(AR724X_PCI_CRP_BASE, PCIR_COMMAND, reg, 2);
+	ar724x_pci_write(AR724X_PCI_CRP_BASE, 0x20, 0x1ff01000, 4);
+	ar724x_pci_write(AR724X_PCI_CRP_BASE, 0x24, 0x1ff01000, 4);
+
+	reg = ATH_READ_REG(AR724X_PCI_RESET);
+	if (reg != 0x7) {
+		DELAY(100000);
+		ATH_WRITE_REG(AR724X_PCI_RESET, 0);
+		DELAY(100);
+		ATH_WRITE_REG(AR724X_PCI_RESET, 4);
+		DELAY(100000);
+	}
+
+	if (ar71xx_soc == AR71XX_SOC_AR7240)
+		reg = AR724X_PCI_APP_LTSSM_ENABLE;
+	else
+		reg = 0x1ffc1;
+	ATH_WRITE_REG(AR724X_PCI_APP, reg);
+	DELAY(1000);
+
+	reg = ATH_READ_REG(AR724X_PCI_RESET);
+	if ((reg & AR724X_PCI_RESET_LINK_UP) == 0) {
+		device_printf(dev, "no PCIe controller found\n");
+		return (ENXIO);
+	}
+
+	if (ar71xx_soc == AR71XX_SOC_AR7241 ||
+	    ar71xx_soc == AR71XX_SOC_AR7242) {
+		reg = ATH_READ_REG(AR724X_PCI_APP);
+		reg |= (1 << 16);
+		ATH_WRITE_REG(AR724X_PCI_APP, reg);
+	}
+
+	return (0);
+}
+
+#define	AR5416_EEPROM_MAGIC		0xa55a
+
+/*
+ * XXX - This should not be here ! And this looks like Atheros (if_ath) only.
+ */
+static void
+ar724x_load_eeprom_data(device_t dev)
+{
+	uint32_t	bar0, hint, reg, val;
+	uint16_t	*data = NULL;
+
+	/* Search for a hint of eeprom data offset */
+	if (resource_int_value(device_get_name(dev),
+	    device_get_unit(dev), "eepromdata", &hint) != 0)
+		return;
+
+	device_printf(dev, "Loading the eeprom fixup data from %#x\n", hint);
+	data = (uint16_t *)MIPS_PHYS_TO_KSEG1(hint);
+
+	if (*data != AR5416_EEPROM_MAGIC) {
+		device_printf(dev, "Invalid calibration data from %#x\n", hint);
+		return;
+	}
+
+	/* Save bar(0) address - just to flush bar(0) (SoC WAR) ? */
+	bar0 = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_BAR(0), 4);
+
+	val = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_COMMAND, 2);
+	val |= (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN);
+	ar724x_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, val, 2); 
+
+	/* set pointer to first reg address */
+	data += 3;
+	while (*data != 0xffff) {
+		reg = *data++;
+		val = *data++;
+		val |= (*data++) << 16;
+
+		/* Write eeprom fixup data to device memory */
+		ATH_WRITE_REG(AR71XX_PCI_MEM_BASE + reg, val);
+		DELAY(100);
+	}
+
+	val = ar724x_pci_read_config(dev, 0, 0, 0, PCIR_COMMAND, 2);
+	val &= ~(PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN);
+	ar724x_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, val, 2); 
+
+	/* Write the saved bar(0) address */
+	ar724x_pci_write_config(dev, 0, 0, 0, PCIR_BAR(0), bar0, 4);
+}
+
+#undef	AR5416_EEPROM_MAGIC
+
+static int
+ar724x_pci_probe(device_t dev)
+{
+
+	return (0);
+}
+
+static int
+ar724x_pci_attach(device_t dev)
+{
+	struct ar71xx_pci_softc *sc = device_get_softc(dev);
+	int busno = 0;
+	int rid = 0;
+
+	sc->sc_mem_rman.rm_type = RMAN_ARRAY;
+	sc->sc_mem_rman.rm_descr = "ar724x PCI memory window";
+	if (rman_init(&sc->sc_mem_rman) != 0 || 
+	    rman_manage_region(&sc->sc_mem_rman, AR71XX_PCI_MEM_BASE, 
+		AR71XX_PCI_MEM_BASE + AR71XX_PCI_MEM_SIZE - 1) != 0) {
+		panic("ar724x_pci_attach: failed to set up I/O rman");
+	}
+
+	sc->sc_irq_rman.rm_type = RMAN_ARRAY;
+	sc->sc_irq_rman.rm_descr = "ar724x PCI IRQs";
+	if (rman_init(&sc->sc_irq_rman) != 0 ||
+	    rman_manage_region(&sc->sc_irq_rman, AR71XX_PCI_IRQ_START, 
+	        AR71XX_PCI_IRQ_END) != 0)
+		panic("ar724x_pci_attach: failed to set up IRQ rman");
+
+	/* Disable interrupts */
+	ATH_WRITE_REG(AR724X_PCI_INTR_STATUS, 0);
+	ATH_WRITE_REG(AR724X_PCI_INTR_MASK, 0);
+
+	/* Hook up our interrupt handler. */
+	if ((sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
+	    RF_SHAREABLE | RF_ACTIVE)) == NULL) {
+		device_printf(dev, "unable to allocate IRQ resource\n");
+		return (ENXIO);
+	}
+
+	if ((bus_setup_intr(dev, sc->sc_irq, INTR_TYPE_MISC,
+			    ar724x_pci_intr, NULL, sc, &sc->sc_ih))) {
+		device_printf(dev, 
+		    "WARNING: unable to register interrupt handler\n");
+		return (ENXIO);
+	}
+
+	/* Reset PCIe core and PCIe PHY */
+	ar71xx_device_stop(AR724X_RESET_PCIE);
+	ar71xx_device_stop(AR724X_RESET_PCIE_PHY);
+	ar71xx_device_stop(AR724X_RESET_PCIE_PHY_SERIAL);
+	DELAY(100);
+
+	ar71xx_device_start(AR724X_RESET_PCIE_PHY_SERIAL);
+	DELAY(100);
+	ar71xx_device_start(AR724X_RESET_PCIE_PHY);
+	ar71xx_device_start(AR724X_RESET_PCIE);
+
+	if (ar724x_pci_setup(dev))
+		return (ENXIO);
+
+	/* XXX - Load eeprom fixup data */
+	ar724x_load_eeprom_data(dev);
+
+	/* Fixup internal PCI bridge */
+	ar724x_pci_write_config(dev, 0, 0, 0, PCIR_COMMAND, 
+            PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN 
+	    | PCIM_CMD_SERRESPEN | PCIM_CMD_BACKTOBACK
+	    | PCIM_CMD_PERRESPEN | PCIM_CMD_MWRICEN, 2);
+
+	device_add_child(dev, "pci", busno);
+	return (bus_generic_attach(dev));
+}
+
+static int
+ar724x_pci_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
+{
+	struct ar71xx_pci_softc *sc = device_get_softc(dev);
+
+	switch (which) {
+	case PCIB_IVAR_DOMAIN:
+		*result = 0;
+		return (0);
+	case PCIB_IVAR_BUS:
+		*result = sc->sc_busno;
+		return (0);
+	}
+
+	return (ENOENT);
+}
+
+static int
+ar724x_pci_write_ivar(device_t dev, device_t child, int which, uintptr_t result)
+{
+	struct ar71xx_pci_softc * sc = device_get_softc(dev);
+
+	switch (which) {
+	case PCIB_IVAR_BUS:
+		sc->sc_busno = result;
+		return (0);
+	}
+
+	return (ENOENT);
+}
+
+static struct resource *
+ar724x_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
+    u_long start, u_long end, u_long count, u_int flags)
+{
+	struct ar71xx_pci_softc *sc = device_get_softc(bus);	
+	struct resource *rv;
+	struct rman *rm;
+
+	switch (type) {
+	case SYS_RES_IRQ:
+		rm = &sc->sc_irq_rman;
+		break;
+	case SYS_RES_MEMORY:
+		rm = &sc->sc_mem_rman;
+		break;
+	default:
+		return (NULL);
+	}
+
+	rv = rman_reserve_resource(rm, start, end, count, flags, child);
+
+	if (rv == NULL)
+		return (NULL);
+
+	rman_set_rid(rv, *rid);
+
+	if (flags & RF_ACTIVE) {
+		if (bus_activate_resource(child, type, *rid, rv)) {
+			rman_release_resource(rv);
+			return (NULL);
+		}
+	} 
+
+
+	return (rv);
+}
+
+static int
+ar724x_pci_activate_resource(device_t bus, device_t child, int type, int rid,
+    struct resource *r)
+{
+	int res = (BUS_ACTIVATE_RESOURCE(device_get_parent(bus),
+	    child, type, rid, r));
+
+	if (!res) {
+		switch(type) {
+		case SYS_RES_MEMORY:
+		case SYS_RES_IOPORT:
+
+			/* XXX */
+			//rman_set_bustag(r, ar71xx_bus_space_pcimem);
+			//rman_set_bustag(r, mips_bus_space_generic);
+			rman_set_bustag(r, ar71xx_bus_space_reversed);
+			break;
+		}
+	}
+
+	return (res);
+}
+
+static int
+ar724x_pci_setup_intr(device_t bus, device_t child, struct resource *ires,
+		int flags, driver_filter_t *filt, driver_intr_t *handler,
+		void *arg, void **cookiep)
+{
+	struct ar71xx_pci_softc *sc = device_get_softc(bus);
+	struct intr_event *event;
+	int irq, error;
+
+	irq = rman_get_start(ires);
+	if (irq > AR71XX_PCI_IRQ_END)
+		panic("%s: bad irq %d", __func__, irq);
+
+	event = sc->sc_eventstab[irq];
+	if (event == NULL) {
+		error = intr_event_create(&event, (void *)irq, 0, irq, 
+		    ar724x_pci_mask_irq, ar724x_pci_unmask_irq, NULL, NULL,
+		    "pci intr%d:", irq);
+
+		if (error == 0) {
+			sc->sc_eventstab[irq] = event;
+			sc->sc_intr_counter[irq] =
+			    mips_intrcnt_create(event->ie_name);
+		}
+		else
+			return error;
+	}
+
+	intr_event_add_handler(event, device_get_nameunit(child), filt,
+	    handler, arg, intr_priority(flags), flags, cookiep);
+	mips_intrcnt_setname(sc->sc_intr_counter[irq], event->ie_fullname);
+
+	ar724x_pci_unmask_irq((void*)irq);
+
+	return (0);
+}
+
+static int
+ar724x_pci_teardown_intr(device_t dev, device_t child, struct resource *ires,
+    void *cookie)
+{
+	struct ar71xx_pci_softc *sc = device_get_softc(dev);
+	int irq, result;
+
+	irq = rman_get_start(ires);
+	if (irq > AR71XX_PCI_IRQ_END)
+		panic("%s: bad irq %d", __func__, irq);
+
+	if (sc->sc_eventstab[irq] == NULL)
+		panic("Trying to teardown unoccupied IRQ");
+
+	ar724x_pci_mask_irq((void*)irq);
+
+	result = intr_event_remove_handler(cookie);
+	if (!result)
+		sc->sc_eventstab[irq] = NULL;
+
+	return (result);
+}
+
+static int
+ar724x_pci_intr(void *arg)
+{
+	struct ar71xx_pci_softc *sc = arg;
+	struct intr_event *event;
+	uint32_t reg, irq, mask;
+
+	ar71xx_device_ddr_flush_ip2();
+
+	reg = ATH_READ_REG(AR724X_PCI_INTR_STATUS);
+	mask = ATH_READ_REG(AR724X_PCI_INTR_MASK);
+	/*
+	 * Handle only unmasked interrupts
+	 */
+	reg &= mask;
+	if (reg & AR724X_PCI_INTR_DEV0) {
+
+		irq = AR71XX_PCI_IRQ_START;
+		event = sc->sc_eventstab[irq];
+		if (!event || TAILQ_EMPTY(&event->ie_handlers)) {
+			printf("Stray IRQ %d\n", irq);
+			return (FILTER_STRAY);
+		}
+
+		/* TODO: frame instead of NULL? */
+		intr_event_handle(event, NULL);
+		mips_intrcnt_inc(sc->sc_intr_counter[irq]);
+	}
+
+	return (FILTER_HANDLED);
+}
+
+static int
+ar724x_pci_maxslots(device_t dev)
+{
+
+	return (PCI_SLOTMAX);
+}
+
+static int
+ar724x_pci_route_interrupt(device_t pcib, device_t device, int pin)
+{
+
+	return (pci_get_slot(device));
+}
+
+static device_method_t ar724x_pci_methods[] = {
+	/* Device interface */
+	DEVMETHOD(device_probe,		ar724x_pci_probe),
+	DEVMETHOD(device_attach,	ar724x_pci_attach),
+	DEVMETHOD(device_shutdown,	bus_generic_shutdown),
+	DEVMETHOD(device_suspend,	bus_generic_suspend),
+	DEVMETHOD(device_resume,	bus_generic_resume),
+
+	/* Bus interface */
+	DEVMETHOD(bus_print_child,	bus_generic_print_child),
+	DEVMETHOD(bus_read_ivar,	ar724x_pci_read_ivar),
+	DEVMETHOD(bus_write_ivar,	ar724x_pci_write_ivar),
+	DEVMETHOD(bus_alloc_resource,	ar724x_pci_alloc_resource),
+	DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
+	DEVMETHOD(bus_activate_resource, ar724x_pci_activate_resource),
+	DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+	DEVMETHOD(bus_setup_intr,	ar724x_pci_setup_intr),
+	DEVMETHOD(bus_teardown_intr,	ar724x_pci_teardown_intr),
+
+	/* pcib interface */
+	DEVMETHOD(pcib_maxslots,	ar724x_pci_maxslots),
+	DEVMETHOD(pcib_read_config,	ar724x_pci_read_config),
+	DEVMETHOD(pcib_write_config,	ar724x_pci_write_config),
+	DEVMETHOD(pcib_route_interrupt,	ar724x_pci_route_interrupt),
+
+	{0, 0}
+};
+
+static driver_t ar724x_pci_driver = {
+	"pcib",
+	ar724x_pci_methods,
+	sizeof(struct ar71xx_pci_softc),
+};
+
+static devclass_t ar724x_pci_devclass;
+
+DRIVER_MODULE(ar724x_pci, nexus, ar724x_pci_driver, ar724x_pci_devclass, 0, 0);

Modified: head/sys/mips/atheros/ar724xreg.h
==============================================================================
--- head/sys/mips/atheros/ar724xreg.h	Sat Apr 30 11:30:42 2011	(r221253)
+++ head/sys/mips/atheros/ar724xreg.h	Sat Apr 30 11:36:16 2011	(r221254)
@@ -49,24 +49,44 @@
 
 #define	AR724X_DDR_REG_FLUSH_GE0	(AR71XX_DDR_CONFIG + 0x7c)
 #define	AR724X_DDR_REG_FLUSH_GE1	(AR71XX_DDR_CONFIG + 0x80)
+#define	AR724X_DDR_REG_FLUSH_USB	(AR71XX_DDR_CONFIG + 0x84)
+#define	AR724X_DDR_REG_FLUSH_PCIE	(AR71XX_DDR_CONFIG + 0x88)
 
 #define	AR724X_RESET_REG_RESET_MODULE	AR71XX_RST_BLOCK_BASE + 0x1c
 #define	AR724X_RESET_USB_HOST			(1 << 5)
 #define	AR724X_RESET_USB_PHY			(1 << 4)
 #define	AR724X_RESET_MODULE_USB_OHCI_DLL	(1 << 3)
 
+#define	AR724X_RESET_GE1_MDIO			(1 << 23)
+#define	AR724X_RESET_GE0_MDIO			(1 << 22)
+#define	AR724X_RESET_PCIE_PHY_SERIAL		(1 << 10)
+#define	AR724X_RESET_PCIE_PHY			(1 << 7)
+#define	AR724X_RESET_PCIE			(1 << 6)
+#define	AR724X_RESET_USB_HOST			(1 << 5)
+#define	AR724X_RESET_USB_PHY			(1 << 4)
+#define	AR724X_RESET_USBSUS_OVERRIDE		(1 << 3)
+
 /* XXX so USB requires different init code? -adrian */
 #define	AR7240_OHCI_BASE		0x1b000000
 #define	AR7240_OHCI_SIZE		0x01000000
-#define	AR724X_DDR_REG_FLUSH_USB	(AR71XX_DDR_CONFIG + 0x84)
-#define	AR724X_DDR_REG_FLUSH_PCIE	(AR71XX_DDR_CONFIG + 0x88)
 
 #define	AR724X_PCI_CRP_BASE		(AR71XX_APB_BASE + 0x000C0000)
 #define	AR724X_PCI_CRP_SIZE		0x100
+#define	AR724X_PCI_CFG_BASE		0x14000000
+#define	AR724X_PCI_CFG_SIZE		0x1000
 
 #define	AR724X_PCI_CTRL_BASE		(AR71XX_APB_BASE + 0x000F0000)
 #define	AR724X_PCI_CTRL_SIZE		0x100
 
+/* PCI config registers */
+#define	AR724X_PCI_APP			0x180f0000
+#define	AR724X_PCI_APP_LTSSM_ENABLE	(1 << 0)
+#define	AR724X_PCI_RESET		0x180f0018
+#define	AR724X_PCI_RESET_LINK_UP	(1 << 0)
+#define	AR724X_PCI_INTR_STATUS		0x180f004c
+#define	AR724X_PCI_INTR_MASK		0x180f0050
+#define	AR724X_PCI_INTR_DEV0		(1 << 14)
+
 #define	AR724X_GPIO_FUNC_GE0_MII_CLK_EN		(1 >> 19)
 #define	AR724X_GPIO_FUNC_SPI_EN			(1 >> 18)
 #define	AR724X_GPIO_FUNC_SPI_CS_EN2		(1 >> 14)

Modified: head/sys/mips/atheros/files.ar71xx
==============================================================================
--- head/sys/mips/atheros/files.ar71xx	Sat Apr 30 11:30:42 2011	(r221253)
+++ head/sys/mips/atheros/files.ar71xx	Sat Apr 30 11:36:16 2011	(r221254)
@@ -6,6 +6,7 @@ mips/atheros/ar71xx_machdep.c	standard
 mips/atheros/ar71xx_ehci.c	optional ehci
 mips/atheros/ar71xx_ohci.c	optional ohci
 mips/atheros/ar71xx_pci.c	optional ar71xx_pci pci
+mips/atheros/ar724x_pci.c	optional ar724x_pci pci
 mips/atheros/ar71xx_pci_bus_space.c	optional pci
 mips/atheros/ar71xx_spi.c	optional ar71xx_spi
 mips/atheros/pcf2123_rtc.c	optional pcf2123_rtc ar71xx_spi

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:40:32 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5093D106564A;
	Sat, 30 Apr 2011 11:40:32 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 408198FC0C;
	Sat, 30 Apr 2011 11:40:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBeW1R044210;
	Sat, 30 Apr 2011 11:40:32 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBeWKR044208;
	Sat, 30 Apr 2011 11:40:32 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301140.p3UBeWKR044208@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 11:40:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221255 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:40:32 -0000

Author: adrian
Date: Sat Apr 30 11:40:31 2011
New Revision: 221255
URL: http://svn.freebsd.org/changeset/base/221255

Log:
  Flip off debugging for now.

Modified:
  head/sys/mips/atheros/ar724x_pci.c

Modified: head/sys/mips/atheros/ar724x_pci.c
==============================================================================
--- head/sys/mips/atheros/ar724x_pci.c	Sat Apr 30 11:36:16 2011	(r221254)
+++ head/sys/mips/atheros/ar724x_pci.c	Sat Apr 30 11:40:31 2011	(r221255)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#define	AR724X_PCI_DEBUG
+#undef	AR724X_PCI_DEBUG
 #ifdef AR724X_PCI_DEBUG
 #define dprintf printf
 #else

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 11:56:05 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 21BA5106564A;
	Sat, 30 Apr 2011 11:56:05 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 115F88FC14;
	Sat, 30 Apr 2011 11:56:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UBu4lN044691;
	Sat, 30 Apr 2011 11:56:04 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UBu49l044689;
	Sat, 30 Apr 2011 11:56:04 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301156.p3UBu49l044689@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 11:56:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221256 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 11:56:05 -0000

Author: adrian
Date: Sat Apr 30 11:56:04 2011
New Revision: 221256
URL: http://svn.freebsd.org/changeset/base/221256

Log:
  Call the DDR FIFO flush method when IP2 interrupts occur.

Modified:
  head/sys/mips/atheros/ar71xx_pci.c

Modified: head/sys/mips/atheros/ar71xx_pci.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_pci.c	Sat Apr 30 11:40:31 2011	(r221255)
+++ head/sys/mips/atheros/ar71xx_pci.c	Sat Apr 30 11:56:04 2011	(r221256)
@@ -500,6 +500,9 @@ ar71xx_pci_intr(void *arg)
 				continue;
 			}
 
+			/* Flush DDR FIFO for IP2 */
+			ar71xx_device_ddr_flush_ip2();
+
 			/* TODO: frame instead of NULL? */
 			intr_event_handle(event, NULL);
 			mips_intrcnt_inc(sc->sc_intr_counter[irq]);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 12:07:16 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1DAB2106566C;
	Sat, 30 Apr 2011 12:07:16 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0D3328FC0A;
	Sat, 30 Apr 2011 12:07:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UC7Fli045047;
	Sat, 30 Apr 2011 12:07:15 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UC7FEr045045;
	Sat, 30 Apr 2011 12:07:15 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301207.p3UC7FEr045045@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 12:07:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221257 - head/sys/mips/atheros
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 12:07:16 -0000

Author: adrian
Date: Sat Apr 30 12:07:15 2011
New Revision: 221257
URL: http://svn.freebsd.org/changeset/base/221257

Log:
  The AR724x SoC's require the irq status line to be acked/cleared.
  
  This allows console IO to occur correctly once the kernel is in multi-user
  mode.
  
  Submitted by:	Luiz Otavio O Souza

Modified:
  head/sys/mips/atheros/apb.c

Modified: head/sys/mips/atheros/apb.c
==============================================================================
--- head/sys/mips/atheros/apb.c	Sat Apr 30 11:56:04 2011	(r221256)
+++ head/sys/mips/atheros/apb.c	Sat Apr 30 12:07:15 2011	(r221257)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #undef APB_DEBUG
 #ifdef APB_DEBUG
@@ -337,6 +338,20 @@ apb_intr(void *arg)
 	reg = ATH_READ_REG(AR71XX_MISC_INTR_STATUS);
 	for (irq = 0; irq < APB_NIRQS; irq++) {
 		if (reg & (1 << irq)) {
+
+			switch (ar71xx_soc) {
+			case AR71XX_SOC_AR7240:
+			case AR71XX_SOC_AR7241:
+			case AR71XX_SOC_AR7242:
+				/* Ack/clear the irq on status register for AR724x */
+				ATH_WRITE_REG(AR71XX_MISC_INTR_STATUS,
+				    reg & ~(1 << irq));
+				break;
+			default:
+				/* fallthrough */
+				break;
+			}
+
 			event = sc->sc_eventstab[irq];
 			if (!event || TAILQ_EMPTY(&event->ie_handlers)) {
 				/* Ignore timer interrupts */

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 12:07:31 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 663A81065742;
	Sat, 30 Apr 2011 12:07:31 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 55BBD8FC0A;
	Sat, 30 Apr 2011 12:07:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UC7Vce045090;
	Sat, 30 Apr 2011 12:07:31 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UC7V9Y045088;
	Sat, 30 Apr 2011 12:07:31 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301207.p3UC7V9Y045088@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 12:07:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221258 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 12:07:31 -0000

Author: bz
Date: Sat Apr 30 12:07:31 2011
New Revision: 221258
URL: http://svn.freebsd.org/changeset/base/221258

Log:
  Add some more missing optional dependencies on inet6, not only inet,
  to get the files for an IPv6 only kernel as well, remove extra inet6
  option where not needed.
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Apr 30 12:07:15 2011	(r221257)
+++ head/sys/conf/files	Sat Apr 30 12:07:31 2011	(r221258)
@@ -2516,7 +2516,7 @@ net/bpf_jitter.c		optional bpf_jitter
 net/bpf_filter.c		optional bpf | netgraph_bpf
 net/bpf_zerocopy.c		optional bpf
 net/bridgestp.c			optional bridge | if_bridge
-net/flowtable.c			optional flowtable inet
+net/flowtable.c			optional flowtable inet | flowtable inet6
 net/ieee8023ad_lacp.c		optional lagg
 net/if.c			standard
 net/if_arcsubr.c		optional arcnet
@@ -2736,10 +2736,10 @@ netinet/ipfw/ip_fw_nat.c	optional inet i
 netinet/ip_icmp.c		optional inet | inet6
 netinet/ip_input.c		optional inet
 netinet/ip_ipsec.c		optional inet ipsec
-netinet/ip_mroute.c		optional mrouting inet | mrouting inet6
+netinet/ip_mroute.c		optional mrouting inet
 netinet/ip_options.c		optional inet
 netinet/ip_output.c		optional inet
-netinet/raw_ip.c		optional inet
+netinet/raw_ip.c		optional inet | inet6
 netinet/cc/cc.c			optional inet | inet6
 netinet/cc/cc_newreno.c		optional inet | inet6
 netinet/sctp_asconf.c		optional inet sctp
@@ -3207,7 +3207,7 @@ security/mac/mac_atalk.c	optional mac ne
 security/mac/mac_audit.c	optional mac audit
 security/mac/mac_cred.c		optional mac
 security/mac/mac_framework.c	optional mac
-security/mac/mac_inet.c		optional mac inet
+security/mac/mac_inet.c		optional mac inet | inet6
 security/mac/mac_inet6.c	optional mac inet6
 security/mac/mac_label.c	optional mac
 security/mac/mac_net.c		optional mac

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 12:22:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08DEA106564A;
	Sat, 30 Apr 2011 12:22:39 +0000 (UTC)
	(envelope-from rmacklem@uoguelph.ca)
Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca
	[131.104.91.36])
	by mx1.freebsd.org (Postfix) with ESMTP id 7EE3F8FC13;
	Sat, 30 Apr 2011 12:22:38 +0000 (UTC)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ApwEAJX+u02DaFvO/2dsb2JhbACEUaI9iHGpRZAlgSqDVYEBBI55hnyHQg
X-IronPort-AV: E=Sophos;i="4.64,292,1301889600"; d="scan'208";a="119171608"
Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca)
	([131.104.91.206])
	by esa-annu-pri.mail.uoguelph.ca with ESMTP; 30 Apr 2011 08:22:37 -0400
Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1])
	by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 90C1AB3F22;
	Sat, 30 Apr 2011 08:22:37 -0400 (EDT)
Date: Sat, 30 Apr 2011 08:22:37 -0400 (EDT)
From: Rick Macklem 
To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
Message-ID: <738601084.807794.1304166157585.JavaMail.root@erie.cs.uoguelph.ca>
In-Reply-To: <86y62sfsil.fsf@ds4.des.no>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [172.17.91.201]
X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - IE7 (Win)/6.0.10_GA_2692)
Cc: svn-src-head@freebsd.org, Rick Macklem ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r221124 - in head: . sbin/mount sbin/mount_nfs
 sys/amd64/conf sys/fs/nfsclient sys/i386/conf sys/ia64/conf sys/nfsclient
 sys/pc98/conf sys/powerpc/conf sys/sparc64/conf sys/sun4v/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 12:22:39 -0000

> Rick Macklem  writes:
> > Log:
> >   This patch changes head so that the default NFS client is now the
> >   new
> >   NFS client (which I guess is no longer experimental). The fstype
> >   "newnfs"
> >   is now "nfs" and the regular/old NFS client is now fstype
> >   "oldnfs".
> 
> Are you going to rename the sysctls as well?
> 
I was not planning on it, but it the "collective" thinks it's a good
idea, I could do so.

For the new NFS, the sysctls all live under vfs.newnfs (a lot of the
code is shared between client and server, so it would be difficult to
separate them out). Ones that are common with the old NFS use the
same names, but there are also a bunch of new ones that have different
names.

rick

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 12:25:10 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6FA71106566B;
	Sat, 30 Apr 2011 12:25:10 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5274A8FC20;
	Sat, 30 Apr 2011 12:25:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UCPABh045687;
	Sat, 30 Apr 2011 12:25:10 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UCPAlL045685;
	Sat, 30 Apr 2011 12:25:10 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201104301225.p3UCPAlL045685@svn.freebsd.org>
From: Adrian Chadd 
Date: Sat, 30 Apr 2011 12:25:10 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221259 - head/sys/mips/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 12:25:10 -0000

Author: adrian
Date: Sat Apr 30 12:25:09 2011
New Revision: 221259
URL: http://svn.freebsd.org/changeset/base/221259

Log:
  An example configuration file for the Atheros PB92.
  
  TODO:
  
  * pcie doesn't yet work properly, I'm working on it.
  * if_arge doesn't work - it's likely the phy mask is wrong; again I'm working on it.

Added:
  head/sys/mips/conf/PB92   (contents, props changed)
  head/sys/mips/conf/PB92.hints   (contents, props changed)

Added: head/sys/mips/conf/PB92
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/PB92	Sat Apr 30 12:25:09 2011	(r221259)
@@ -0,0 +1,100 @@
+#
+# PB92 -- Kernel configuration file for FreeBSD/mips for Atheros PB92 reference
+#         board (AR7242)
+#
+# $FreeBSD$
+#
+
+ident		PB92
+makeoptions	KERNLOADADDR=0x80050000
+options		HZ=1000
+
+hints		"PB92.hints"
+include		"../atheros/std.ar71xx"
+
+makeoptions	DEBUG=-g		#Build kernel with gdb(1) debug symbols
+makeoptions	MODULES_OVERRIDE=""
+
+options		DDB
+options		KDB
+
+options		SCHED_4BSD		#4BSD scheduler
+options		INET			#InterNETworking
+options		INET6
+options		NFSCLIENT		#Network Filesystem Client
+options		PSEUDOFS		#Pseudo-filesystem framework
+options		_KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
+options		ALQ
+
+# options		NFS_LEGACYRPC
+#options		NFS_DEBUG
+
+# Debugging for use in -current
+options		DEADLKRES
+options		INVARIANTS
+options		INVARIANT_SUPPORT
+options		WITNESS
+options		WITNESS_SKIPSPIN
+options         FFS                     #Berkeley Fast Filesystem
+#options         SOFTUPDATES             #Enable FFS soft updates support
+#options         UFS_ACL                 #Support for access control lists
+#options         UFS_DIRHASH             #Improve performance on big directories
+
+options		MD_ROOT
+options		MD_ROOT_SIZE=5120
+device		geom_uzip
+options		GEOM_UZIP
+options		ROOTDEVNAME=\"ufs:/dev/md0.uzip\"
+
+device		pci
+device		ar724x_pci
+
+# Wireless NIC cards
+options		IEEE80211_DEBUG
+options		IEEE80211_SUPPORT_MESH
+options		IEEE80211_SUPPORT_TDMA
+device		wlan            # 802.11 support
+device		wlan_wep        # 802.11 WEP support
+device		wlan_ccmp       # 802.11 CCMP support
+device		wlan_tkip       # 802.11 TKIP support
+device		wlan_xauth	# 802.11 hostap support
+
+device		ath		# Atheros pci/cardbus NIC's
+device		ath_pci		# PCI/PCIe bus glue
+options 	ATH_DEBUG
+options		ATH_ENABLE_11N
+options		ATH_DIAGAPI
+
+device		ath_hal
+options		AH_SUPPORT_AR5416
+options		AH_DEBUG
+options		AH_DEBUG_ALQ
+
+device		ath_rate_sample
+
+device		mii
+device		arge
+
+device		usb
+options		USB_EHCI_BIG_ENDIAN_DESC        # handle big-endian byte order
+options		USB_DEBUG
+options		USB_HOST_ALIGN=32
+device		ehci
+
+device		gpio
+device		gpioled
+
+device		spibus
+device		ar71xx_spi
+device		mx25l
+
+device		ar71xx_wdog
+
+device		uart
+
+device		loop
+device		ether
+device		md
+device		bpf
+device		random
+device		if_bridge

Added: head/sys/mips/conf/PB92.hints
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/conf/PB92.hints	Sat Apr 30 12:25:09 2011	(r221259)
@@ -0,0 +1,65 @@
+# $FreeBSD$
+hint.apb.0.at="nexus0"
+hint.apb.0.irq=4
+
+# uart0
+hint.uart.0.at="apb0"
+# see atheros/uart_cpu_ar71xx.c why +3
+hint.uart.0.maddr=0x18020003
+hint.uart.0.msize=0x18
+hint.uart.0.irq=3
+
+# ohci
+#hint.ohci.0.at="apb0"
+#hint.ohci.0.maddr=0x1b000000
+#hint.ohci.0.msize=0x01000000
+#hint.ohci.0.irq=1
+
+#ehci - note the 0x100 offset for the AR913x/AR724x
+hint.ehci.0.at="nexus0"
+hint.ehci.0.maddr=0x1b000100
+hint.ehci.0.msize=0x00ffff00
+hint.ehci.0.irq=1
+
+# pci
+hint.pcib.0.at="nexus0"
+hint.pcib.0.irq=0
+
+# arge0
+hint.arge.0.at="nexus0"
+hint.arge.0.maddr=0x19000000
+hint.arge.0.msize=0x1000
+hint.arge.0.irq=2
+hint.arge.0.phymask=0x1
+
+# GPIO
+hint.gpio.0.at="apb0"
+hint.gpio.0.maddr=0x18040000
+hint.gpio.0.msize=0x1000
+hint.gpio.0.irq=2
+
+# Signal leds
+hint.gpioled.0.at="gpiobus0"
+hint.gpioled.0.name="sig1"
+hint.gpioled.0.pins=0x0001	# pin 0
+hint.gpioled.1.at="gpiobus0"
+hint.gpioled.1.name="sig2"
+hint.gpioled.1.pins=0x0002	# pin 1
+hint.gpioled.2.at="gpiobus0"
+hint.gpioled.2.name="sig3"
+hint.gpioled.2.pins=0x0800	# pin 11
+hint.gpioled.3.at="gpiobus0"
+hint.gpioled.3.name="sig4"
+hint.gpioled.3.pins=0x0080	# pin 7
+
+# SPI controller/bus
+hint.spi.0.at="nexus0"
+hint.spi.0.maddr=0x1f000000
+hint.spi.0.msize=0x10
+
+# SPI flash
+hint.mx25l.0.at="spibus0"
+hint.mx25l.0.cs=0
+
+# Watchdog
+hint.ar71xx_wdog.0.at="nexus0"

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 12:39:48 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1BF461065670;
	Sat, 30 Apr 2011 12:39:48 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E3FAE8FC1C;
	Sat, 30 Apr 2011 12:39:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UCdlZT046111;
	Sat, 30 Apr 2011 12:39:47 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UCdlRO046109;
	Sat, 30 Apr 2011 12:39:47 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301239.p3UCdlRO046109@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 12:39:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221260 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 12:39:48 -0000

Author: bz
Date: Sat Apr 30 12:39:47 2011
New Revision: 221260
URL: http://svn.freebsd.org/changeset/base/221260

Log:
  After r221249 allow SCTP to be compiled in an IPv6 only environment as well.
  
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	10 days

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Apr 30 12:25:09 2011	(r221259)
+++ head/sys/conf/files	Sat Apr 30 12:39:47 2011	(r221260)
@@ -2742,21 +2742,21 @@ netinet/ip_output.c		optional inet
 netinet/raw_ip.c		optional inet | inet6
 netinet/cc/cc.c			optional inet | inet6
 netinet/cc/cc_newreno.c		optional inet | inet6
-netinet/sctp_asconf.c		optional inet sctp
-netinet/sctp_auth.c		optional inet sctp
-netinet/sctp_bsd_addr.c		optional inet sctp
-netinet/sctp_cc_functions.c	optional inet sctp
-netinet/sctp_crc32.c		optional inet sctp
-netinet/sctp_indata.c		optional inet sctp
-netinet/sctp_input.c		optional inet sctp
-netinet/sctp_output.c		optional inet sctp
-netinet/sctp_pcb.c		optional inet sctp
-netinet/sctp_peeloff.c		optional inet sctp
-netinet/sctp_ss_functions.c	optional inet sctp
-netinet/sctp_sysctl.c		optional inet sctp
-netinet/sctp_timer.c		optional inet sctp
-netinet/sctp_usrreq.c		optional inet sctp
-netinet/sctputil.c		optional inet sctp
+netinet/sctp_asconf.c		optional inet sctp | inet6 sctp
+netinet/sctp_auth.c		optional inet sctp | inet6 sctp
+netinet/sctp_bsd_addr.c		optional inet sctp | inet6 sctp
+netinet/sctp_cc_functions.c	optional inet sctp | inet6 sctp
+netinet/sctp_crc32.c		optional inet sctp | inet6 sctp
+netinet/sctp_indata.c		optional inet sctp | inet6 sctp
+netinet/sctp_input.c		optional inet sctp | inet6 sctp
+netinet/sctp_output.c		optional inet sctp | inet6 sctp
+netinet/sctp_pcb.c		optional inet sctp | inet6 sctp
+netinet/sctp_peeloff.c		optional inet sctp | inet6 sctp
+netinet/sctp_ss_functions.c	optional inet sctp | inet6 sctp
+netinet/sctp_sysctl.c		optional inet sctp | inet6 sctp
+netinet/sctp_timer.c		optional inet sctp | inet6 sctp
+netinet/sctp_usrreq.c		optional inet sctp | inet6 sctp
+netinet/sctputil.c		optional inet sctp | inet6 sctp
 netinet/tcp_debug.c		optional tcpdebug
 netinet/tcp_hostcache.c		optional inet | inet6
 netinet/tcp_input.c		optional inet | inet6

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 13:04:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90E151065670;
	Sat, 30 Apr 2011 13:04:55 +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 488A28FC13;
	Sat, 30 Apr 2011 13:04:55 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 5179A1FFC35;
	Sat, 30 Apr 2011 13:04:54 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 1AB48844D9; Sat, 30 Apr 2011 15:04:54 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Rick Macklem 
References: <738601084.807794.1304166157585.JavaMail.root@erie.cs.uoguelph.ca>
Date: Sat, 30 Apr 2011 15:04:53 +0200
In-Reply-To: <738601084.807794.1304166157585.JavaMail.root@erie.cs.uoguelph.ca>
	(Rick Macklem's message of "Sat, 30 Apr 2011 08:22:37 -0400 (EDT)")
Message-ID: <86mxj7gaa2.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, Rick Macklem ,
	svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r221124 - in head: . sbin/mount sbin/mount_nfs
	sys/amd64/conf sys/fs/nfsclient sys/i386/conf sys/ia64/conf
	sys/nfsclient sys/pc98/conf sys/powerpc/conf sys/sparc64/conf
	sys/sun4v/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 13:04:55 -0000

Rick Macklem  writes:
> "Dag-Erling Sm=C3=B8rgrav"  writes:
> > Are you going to rename the sysctls as well?
> I was not planning on it, but it the "collective" thinks it's a good
> idea, I could do so.

Yes, please.  The change from vfs.nfs to vfs.newnfs breaks scripts.

Ideally, both the old and the new NFS stack would use the same fstypes
and sysctl names, but I don't know if there's any way we can prevent
someone from compiling both into the kernel at the same time, or loading
both modules.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 13:13:14 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E79C7106566B;
	Sat, 30 Apr 2011 13:13:14 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B6348FC14;
	Sat, 30 Apr 2011 13:13:14 +0000 (UTC)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.sbone.de (Postfix) with ESMTPS id 84B9F25D385D;
	Sat, 30 Apr 2011 13:13:13 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
	[IPv6:fde9:577b:c1a9:31::2013:2742])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPS id A706F159E12B;
	Sat, 30 Apr 2011 13:13:12 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
	by content-filter.sbone.de (content-filter.sbone.de
	[fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
	with ESMTP id y9J+8GTdPb7w; Sat, 30 Apr 2011 13:13:11 +0000 (UTC)
Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.sbone.de (Postfix) with ESMTPSA id 7DD21159E0AC;
	Sat, 30 Apr 2011 13:05:42 +0000 (UTC)
Date: Sat, 30 Apr 2011 13:05:41 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: Michael Tuexen 
In-Reply-To: <201104301118.p3UBIGVE043318@svn.freebsd.org>
Message-ID: 
References: <201104301118.p3UBIGVE043318@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r221249 - in head/sys: netinet netinet6
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 13:13:15 -0000

On Sat, 30 Apr 2011, Michael Tuexen wrote:

> Author: tuexen
> Date: Sat Apr 30 11:18:16 2011
> New Revision: 221249
> URL: http://svn.freebsd.org/changeset/base/221249
>
> Log:
>  Improve compilation of SCTP code without INET support.
>  Some bugs where fixed while doing this:
>  * ASCONF-ACK messages might use wrong port number when using
>    IPv6.
>  * Checking for additional addresses takes the correct address
>    into account and also does not do more comparisons than
>    necessary.
>
>  This patch is based on one received from bz@ who was
>  sponsored by The FreeBSD Foundation and iXsystems.

Huge thanks for going through all this, reviewing, integrating it
into the SCTP tree and fixing things!  Very much appreciated!

I'll let you know once the kernel infrastructure is all there (soon)
so you can re-test compiling and properly test in a true IPv6 only
kernel environment.


Bjoern

-- 
Bjoern A. Zeeb                                 You have to have visions!
          Stop bit received. Insert coin for new address family.

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 13:49:03 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D880106566B;
	Sat, 30 Apr 2011 13:49:03 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 899FA8FC0A;
	Sat, 30 Apr 2011 13:49:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UDn3uE048139;
	Sat, 30 Apr 2011 13:49:03 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UDn3w5048136;
	Sat, 30 Apr 2011 13:49:03 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201104301349.p3UDn3w5048136@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 30 Apr 2011 13:49:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221261 - in head/sys: fs/ext2fs ufs/ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 13:49:03 -0000

Author: kib
Date: Sat Apr 30 13:49:03 2011
New Revision: 221261
URL: http://svn.freebsd.org/changeset/base/221261

Log:
  Clarify the comment.
  
  MFC after:	1 week

Modified:
  head/sys/fs/ext2fs/ext2_readwrite.c
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/fs/ext2fs/ext2_readwrite.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_readwrite.c	Sat Apr 30 12:39:47 2011	(r221260)
+++ head/sys/fs/ext2fs/ext2_readwrite.c	Sat Apr 30 13:49:03 2011	(r221261)
@@ -166,7 +166,8 @@ READ(ap)
 			/*
 			 * If it's VMIO or direct I/O, then we don't
 			 * need the buf, mark it available for
-			 * freeing. If it's VMIO, the VM has the data.
+			 * freeing. If it's non-direct VMIO, the VM has
+			 * the data.
 			 */
 			bp->b_flags |= B_RELBUF;
 			brelse(bp);

Modified: head/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vnops.c	Sat Apr 30 12:39:47 2011	(r221260)
+++ head/sys/ufs/ffs/ffs_vnops.c	Sat Apr 30 13:49:03 2011	(r221261)
@@ -591,7 +591,8 @@ ffs_read(ap)
 			/*
 			 * If there are no dependencies, and it's VMIO,
 			 * then we don't need the buf, mark it available
-			 * for freeing. The VM has the data.
+			 * for freeing.  For non-direct VMIO reads, he VM
+			 * has the data.
 			 */
 			bp->b_flags |= B_RELBUF;
 			brelse(bp);
@@ -985,7 +986,8 @@ ffs_extread(struct vnode *vp, struct uio
 			/*
 			 * If there are no dependencies, and it's VMIO,
 			 * then we don't need the buf, mark it available
-			 * for freeing. The VM has the data.
+			 * for freeing.  For non-direct VMIO reads, The VM
+			 * has the data.
 			 */
 			bp->b_flags |= B_RELBUF;
 			brelse(bp);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 14:22:45 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E06C106564A;
	Sat, 30 Apr 2011 14:22:45 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7BC448FC0A;
	Sat, 30 Apr 2011 14:22:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UEMjUP049288;
	Sat, 30 Apr 2011 14:22:45 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UEMjH4049286;
	Sat, 30 Apr 2011 14:22:45 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301422.p3UEMjH4049286@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 14:22:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221262 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 14:22:45 -0000

Author: bz
Date: Sat Apr 30 14:22:45 2011
New Revision: 221262
URL: http://svn.freebsd.org/changeset/base/221262

Log:
  Fis a problem with r221258 that mac is still needed in case for ient6 only
  for mac_inet.c.
  
  Reported by:	Luiz Otavio O Souza (lists.br gmail.com)
  MFC after:	4 days

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Sat Apr 30 13:49:03 2011	(r221261)
+++ head/sys/conf/files	Sat Apr 30 14:22:45 2011	(r221262)
@@ -3207,7 +3207,7 @@ security/mac/mac_atalk.c	optional mac ne
 security/mac/mac_audit.c	optional mac audit
 security/mac/mac_cred.c		optional mac
 security/mac/mac_framework.c	optional mac
-security/mac/mac_inet.c		optional mac inet | inet6
+security/mac/mac_inet.c		optional mac inet | mac inet6
 security/mac/mac_inet6.c	optional mac inet6
 security/mac/mac_label.c	optional mac
 security/mac/mac_net.c		optional mac

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 14:52:49 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EFAE11065670;
	Sat, 30 Apr 2011 14:52:49 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id D28DC8FC15;
	Sat, 30 Apr 2011 14:52:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UEqnjE050163;
	Sat, 30 Apr 2011 14:52:49 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UEqneY050160;
	Sat, 30 Apr 2011 14:52:49 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201104301452.p3UEqneY050160@svn.freebsd.org>
From: Martin Matuska 
Date: Sat, 30 Apr 2011 14:52:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221263 - in
	head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 14:52:50 -0000

Author: mm
Date: Sat Apr 30 14:52:49 2011
New Revision: 221263
URL: http://svn.freebsd.org/changeset/base/221263

Log:
  Fix deduplicated zfs receive
  (dmu_recv_stream builds incomplete guid_to_ds_map)
  
  Illumos-gate changeset:	13329:c48b8bf84ab7
  MFC together with v28
  
  Approved by:	pjd
  Obtained from:	Illumos (Bug #755)

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Apr 30 14:22:45 2011	(r221262)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c	Sat Apr 30 14:52:49 2011	(r221263)
@@ -21,6 +21,9 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ */
 
 #include 
 #include 
@@ -851,61 +854,6 @@ guid_compare(const void *arg1, const voi
 	return (0);
 }
 
-/*
- * This function is a callback used by dmu_objset_find() (which
- * enumerates the object sets) to build an avl tree that maps guids
- * to datasets.  The resulting table is used when processing DRR_WRITE_BYREF
- * send stream records.  These records, which are used in dedup'ed
- * streams, do not contain data themselves, but refer to a copy
- * of the data block that has already been written because it was
- * earlier in the stream.  That previous copy is identified by the
- * guid of the dataset with the referenced data.
- */
-int
-find_ds_by_guid(const char *name, void *arg)
-{
-	avl_tree_t *guid_map = arg;
-	dsl_dataset_t *ds, *snapds;
-	guid_map_entry_t *gmep;
-	dsl_pool_t *dp;
-	int err;
-	uint64_t lastobj, firstobj;
-
-	if (dsl_dataset_hold(name, FTAG, &ds) != 0)
-		return (0);
-
-	dp = ds->ds_dir->dd_pool;
-	rw_enter(&dp->dp_config_rwlock, RW_READER);
-	firstobj = ds->ds_dir->dd_phys->dd_origin_obj;
-	lastobj = ds->ds_phys->ds_prev_snap_obj;
-
-	while (lastobj != firstobj) {
-		err = dsl_dataset_hold_obj(dp, lastobj, guid_map, &snapds);
-		if (err) {
-			/*
-			 * Skip this snapshot and move on. It's not
-			 * clear why this would ever happen, but the
-			 * remainder of the snapshot streadm can be
-			 * processed.
-			 */
-			rw_exit(&dp->dp_config_rwlock);
-			dsl_dataset_rele(ds, FTAG);
-			return (0);
-		}
-
-		gmep = kmem_alloc(sizeof (guid_map_entry_t), KM_SLEEP);
-		gmep->guid = snapds->ds_phys->ds_guid;
-		gmep->gme_ds = snapds;
-		avl_add(guid_map, gmep);
-		lastobj = snapds->ds_phys->ds_prev_snap_obj;
-	}
-
-	rw_exit(&dp->dp_config_rwlock);
-	dsl_dataset_rele(ds, FTAG);
-
-	return (0);
-}
-
 static void
 free_guid_map_onexit(void *arg)
 {
@@ -1413,9 +1361,6 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, 
 			avl_create(ra.guid_to_ds_map, guid_compare,
 			    sizeof (guid_map_entry_t),
 			    offsetof(guid_map_entry_t, avlnode));
-			(void) dmu_objset_find(drc->drc_top_ds, find_ds_by_guid,
-			    (void *)ra.guid_to_ds_map,
-			    DS_FIND_CHILDREN);
 			ra.err = zfs_onexit_add_cb(minor,
 			    free_guid_map_onexit, ra.guid_to_ds_map,
 			    action_handlep);
@@ -1427,6 +1372,8 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, 
 			if (ra.err)
 				goto out;
 		}
+
+		drc->drc_guid_to_ds_map = ra.guid_to_ds_map;
 	}
 
 	/*
@@ -1565,6 +1512,30 @@ recv_end_sync(void *arg1, void *arg2, dm
 }
 
 static int
+add_ds_to_guidmap(avl_tree_t *guid_map, dsl_dataset_t *ds)
+{
+	dsl_pool_t *dp = ds->ds_dir->dd_pool;
+	uint64_t snapobj = ds->ds_phys->ds_prev_snap_obj;
+	dsl_dataset_t *snapds;
+	guid_map_entry_t *gmep;
+	int err;
+
+	ASSERT(guid_map != NULL);
+
+	rw_enter(&dp->dp_config_rwlock, RW_READER);
+	err = dsl_dataset_hold_obj(dp, snapobj, guid_map, &snapds);
+	if (err == 0) {
+		gmep = kmem_alloc(sizeof (guid_map_entry_t), KM_SLEEP);
+		gmep->guid = snapds->ds_phys->ds_guid;
+		gmep->gme_ds = snapds;
+		avl_add(guid_map, gmep);
+	}
+
+	rw_exit(&dp->dp_config_rwlock);
+	return (err);
+}
+
+static int
 dmu_recv_existing_end(dmu_recv_cookie_t *drc)
 {
 	struct recvendsyncarg resa;
@@ -1604,6 +1575,8 @@ dmu_recv_existing_end(dmu_recv_cookie_t 
 
 out:
 	mutex_exit(&ds->ds_recvlock);
+	if (err == 0 && drc->drc_guid_to_ds_map != NULL)
+		(void) add_ds_to_guidmap(drc->drc_guid_to_ds_map, ds);
 	dsl_dataset_disown(ds, dmu_recv_tag);
 	(void) dsl_dataset_destroy(drc->drc_real_ds, dmu_recv_tag, B_FALSE);
 	return (err);
@@ -1633,6 +1606,8 @@ dmu_recv_new_end(dmu_recv_cookie_t *drc)
 		/* clean up the fs we just recv'd into */
 		(void) dsl_dataset_destroy(ds, dmu_recv_tag, B_FALSE);
 	} else {
+		if (drc->drc_guid_to_ds_map != NULL)
+			(void) add_ds_to_guidmap(drc->drc_guid_to_ds_map, ds);
 		/* release the hold from dmu_recv_begin */
 		dsl_dataset_disown(ds, dmu_recv_tag);
 	}

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Sat Apr 30 14:22:45 2011	(r221262)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h	Sat Apr 30 14:52:49 2011	(r221263)
@@ -21,6 +21,9 @@
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  */
+/*
+ * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ */
 
 /* Portions Copyright 2010 Robert Milkowski */
 
@@ -718,6 +721,7 @@ typedef struct dmu_recv_cookie {
 	char *drc_top_ds;
 	boolean_t drc_newfs;
 	boolean_t drc_force;
+	struct avl_tree *drc_guid_to_ds_map;
 } dmu_recv_cookie_t;
 
 int dmu_recv_begin(char *tofs, char *tosnap, char *topds, struct drr_begin *,

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 16:30:19 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2F71610656AD;
	Sat, 30 Apr 2011 16:30:19 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1D1A88FC1B;
	Sat, 30 Apr 2011 16:30:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UGUIhA052985;
	Sat, 30 Apr 2011 16:30:18 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UGUImC052983;
	Sat, 30 Apr 2011 16:30:18 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301630.p3UGUImC052983@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 16:30:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221264 - head/sys/netinet
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 16:30:19 -0000

Author: bz
Date: Sat Apr 30 16:30:18 2011
New Revision: 221264
URL: http://svn.freebsd.org/changeset/base/221264

Log:
  Fix a mismerge from p4 in that in_localaddr() is not available without INET.
  
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	4 days

Modified:
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Sat Apr 30 14:52:49 2011	(r221263)
+++ head/sys/netinet/tcp_input.c	Sat Apr 30 16:30:18 2011	(r221264)
@@ -370,7 +370,11 @@ cc_conn_init(struct tcpcb *tp)
 	else if (isipv6 && in6_localaddr(&inp->in6p_faddr))
 		tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local;
 #endif
-#if defined(INET) || defined(INET6)
+#if defined(INET) && defined(INET6)
+	else if (!isipv6 && in_localaddr(inp->inp_faddr))
+		tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local;
+#endif
+#ifdef INET
 	else if (in_localaddr(inp->inp_faddr))
 		tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local;
 #endif

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 17:51:39 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B2F45106564A;
	Sat, 30 Apr 2011 17:51:39 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 685D68FC0C;
	Sat, 30 Apr 2011 17:51:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UHpdhP056334;
	Sat, 30 Apr 2011 17:51:39 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UHpdrB056332;
	Sat, 30 Apr 2011 17:51:39 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301751.p3UHpdrB056332@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 17:51:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221265 - head/sys/conf
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 17:51:39 -0000

Author: bz
Date: Sat Apr 30 17:51:39 2011
New Revision: 221265
URL: http://svn.freebsd.org/changeset/base/221265

Log:
  Allow MKMODULESENV being preset from other sources like makeoptions
  kernel configurations to apply WITH_* WITHOUT_* knobs we use for
  module building as well to restrict or control opt_*.h flags.
  
  Reviewed by:	imp, +
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	2 weeks

Modified:
  head/sys/conf/kern.pre.mk

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Sat Apr 30 16:30:18 2011	(r221264)
+++ head/sys/conf/kern.pre.mk	Sat Apr 30 17:51:39 2011	(r221265)
@@ -149,7 +149,7 @@ SYSTEM_DEP+= ${LDSCRIPT}
 # MKMODULESENV is set here so that port makefiles can augment
 # them.
 
-MKMODULESENV=	MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
+MKMODULESENV+=	MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR}
 MKMODULESENV+=	MACHINE_CPUARCH=${MACHINE_CPUARCH}
 .if (${KERN_IDENT} == LINT)
 MKMODULESENV+=	ALL_MODULES=LINT

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 17:58:28 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B9B0B106566B;
	Sat, 30 Apr 2011 17:58:28 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A72B78FC14;
	Sat, 30 Apr 2011 17:58:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UHwSPE056585;
	Sat, 30 Apr 2011 17:58:28 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UHwSqm056580;
	Sat, 30 Apr 2011 17:58:28 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301758.p3UHwSqm056580@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 17:58:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221266 - in head: share/man/man5 share/mk
	tools/build/options
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 17:58:28 -0000

Author: bz
Date: Sat Apr 30 17:58:28 2011
New Revision: 221266
URL: http://svn.freebsd.org/changeset/base/221266

Log:
  Introduce two new options MK_INET and MK_INET_SUPPORT analogically
  with INET6 equivalents. Patch reather than re-genenerating src.conf
  (given the current problem with the script that does the re-gen).
  
  Reviewed by:	gnn
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	2 weeks

Added:
  head/tools/build/options/WITHOUT_INET   (contents, props changed)
  head/tools/build/options/WITHOUT_INET_SUPPORT   (contents, props changed)
Modified:
  head/share/man/man5/src.conf.5
  head/share/mk/bsd.own.mk

Modified: head/share/man/man5/src.conf.5
==============================================================================
--- head/share/man/man5/src.conf.5	Sat Apr 30 17:51:39 2011	(r221265)
+++ head/share/man/man5/src.conf.5	Sat Apr 30 17:58:28 2011	(r221266)
@@ -1,7 +1,7 @@
 .\" DO NOT EDIT-- this file is automatically generated.
-.\" from FreeBSD: head/tools/build/options/makeman 188848 2009-02-20 11:09:55Z mtm
+.\" from FreeBSD: head/tools/build/options/makeman 221161 2011-04-28 11:21:49Z des
 .\" $FreeBSD$
-.Dd April  6, 2011
+.Dd April 30, 2011
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -397,6 +397,15 @@ This code is patented in the USA and man
 It is
 .Em "YOUR RESPONSIBILITY"
 to determine if you can legally use IDEA.
+.It Va WITHOUT_INET
+.\" $FreeBSD$
+Set to not build programs and libraries related to IPv4 networking.
+When set, it also enforces the following options:
+.Pp
+.Bl -item -compact
+.It
+.Va WITHOUT_INET_SUPPORT
+.El
 .It Va WITHOUT_INET6
 .\" from FreeBSD: head/tools/build/options/WITHOUT_INET6 156932 2006-03-21 07:50:50Z ru
 Set to not build
@@ -410,6 +419,9 @@ When set, it also enforces the following
 .It Va WITHOUT_INET6_SUPPORT
 .\" from FreeBSD: head/tools/build/options/WITHOUT_INET6_SUPPORT 156932 2006-03-21 07:50:50Z ru
 Set to build libraries, programs, and kernel modules without IPv6 support.
+.It Va WITHOUT_INET_SUPPORT
+.\" $FreeBSD$
+Set to build libraries, programs, and kernel modules without IPv4 support.
 .It Va WITHOUT_INFO
 .\" from FreeBSD: head/tools/build/options/WITHOUT_INFO 156932 2006-03-21 07:50:50Z ru
 Set to not make or install

Modified: head/share/mk/bsd.own.mk
==============================================================================
--- head/share/mk/bsd.own.mk	Sat Apr 30 17:51:39 2011	(r221265)
+++ head/share/mk/bsd.own.mk	Sat Apr 30 17:58:28 2011	(r221266)
@@ -326,6 +326,7 @@ __DEFAULT_YES_OPTIONS = \
     GPIO \
     GROFF \
     HTML \
+    INET \
     INET6 \
     INFO \
     INSTALLLIB \
@@ -546,6 +547,7 @@ MK_GDB:=	no
 .for var in \
     BZIP2 \
     GNU \
+    INET \
     INET6 \
     IPX \
     KERBEROS \

Added: head/tools/build/options/WITHOUT_INET
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_INET	Sat Apr 30 17:58:28 2011	(r221266)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to not build programs and libraries related to IPv4 networking.

Added: head/tools/build/options/WITHOUT_INET_SUPPORT
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_INET_SUPPORT	Sat Apr 30 17:58:28 2011	(r221266)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Set to build libraries, programs, and kernel modules without IPv4 support.

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 17:59:55 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1ECB41065670;
	Sat, 30 Apr 2011 17:59:55 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E6E6D8FC13;
	Sat, 30 Apr 2011 17:59:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UHxsrQ056659;
	Sat, 30 Apr 2011 17:59:54 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UHxsL9056656;
	Sat, 30 Apr 2011 17:59:54 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201104301759.p3UHxsL9056656@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Sat, 30 Apr 2011 17:59:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221267 - in head/sys/modules: . if_carp
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 17:59:55 -0000

Author: bz
Date: Sat Apr 30 17:59:54 2011
New Revision: 221267
URL: http://svn.freebsd.org/changeset/base/221267

Log:
  Update carp, gre and pf module builds to be depenent on INET and/or
  INET6_SUPPORT.
  
  Reviewed by:	gnn (slightly earlier version without pf)
  Sponsored by:	The FreeBSD Foundation
  Sponsored by:	iXsystems
  MFC after:	2 weeks

Modified:
  head/sys/modules/Makefile
  head/sys/modules/if_carp/Makefile

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Sat Apr 30 17:58:28 2011	(r221266)
+++ head/sys/modules/Makefile	Sat Apr 30 17:59:54 2011	(r221267)
@@ -116,14 +116,14 @@ SUBDIR=	${_3dfx} \
 	${_ida} \
 	${_ie} \
 	if_bridge \
-	if_carp \
+	${_if_carp} \
 	if_disc \
 	if_edsc \
 	if_ef \
 	if_epair \
 	if_faith \
 	if_gif \
-	if_gre \
+	${_if_gre} \
 	if_lagg \
 	${_if_ndis} \
 	if_stf \
@@ -358,6 +358,15 @@ _random=	random
 .endif
 .endif
 
+.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
+_if_gre=	if_gre
+.endif
+
+.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
+	defined(ALL_MODULES)
+_if_carp=	if_carp
+.endif
+
 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
 _ipfilter=	ipfilter
 .endif
@@ -366,7 +375,8 @@ _ipfilter=	ipfilter
 _netgraph=	netgraph
 .endif
 
-.if ${MK_PF} != "no" || defined(ALL_MODULES)
+.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
+	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
 _pf=		pf
 _pflog=		pflog
 .endif

Modified: head/sys/modules/if_carp/Makefile
==============================================================================
--- head/sys/modules/if_carp/Makefile	Sat Apr 30 17:58:28 2011	(r221266)
+++ head/sys/modules/if_carp/Makefile	Sat Apr 30 17:59:54 2011	(r221267)
@@ -9,8 +9,10 @@ SRCS=	ip_carp.c
 SRCS+=	opt_carp.h opt_bpf.h opt_inet.h opt_inet6.h vnode_if.h
 
 .if !defined(KERNBUILDDIR)
+.if ${MK_INET_SUPPORT} != "no"
 opt_inet.h:
 	@echo "#define INET 1" > ${.TARGET}
+.endif
 
 .if ${MK_INET6_SUPPORT} != "no"
 opt_inet6.h:

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 20:16:50 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5275F106566B;
	Sat, 30 Apr 2011 20:16:50 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E77A8FC08;
	Sat, 30 Apr 2011 20:16:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UKGoWi060698;
	Sat, 30 Apr 2011 20:16:50 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UKGohj060695;
	Sat, 30 Apr 2011 20:16:50 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201104302016.p3UKGohj060695@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 30 Apr 2011 20:16:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221269 - in head/sys/boot/ia64: common efi
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 20:16:50 -0000

Author: marcel
Date: Sat Apr 30 20:16:49 2011
New Revision: 221269
URL: http://svn.freebsd.org/changeset/base/221269

Log:
  Turn PBVM page table entries into PTEs so that they can be inserted
  into the TLB as-is.
  
  While here, have ia64_platform_alloc() return ~0UL on failure.

Modified:
  head/sys/boot/ia64/common/copy.c
  head/sys/boot/ia64/efi/efimd.c

Modified: head/sys/boot/ia64/common/copy.c
==============================================================================
--- head/sys/boot/ia64/common/copy.c	Sat Apr 30 20:14:20 2011	(r221268)
+++ head/sys/boot/ia64/common/copy.c	Sat Apr 30 20:16:49 2011	(r221269)
@@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 
 #include "libia64.h"
 
@@ -40,6 +41,7 @@ uint32_t ia64_pgtblsz;
 static int
 pgtbl_extend(u_int idx)
 {
+	vm_paddr_t pa;
 	uint64_t *pgtbl;
 	uint32_t pgtblsz;
 	u_int pot;
@@ -65,9 +67,10 @@ pgtbl_extend(u_int idx)
 		pgtblsz <<= 1;
 
 	/* Allocate naturally aligned memory. */
-	pgtbl = (void *)ia64_platform_alloc(0, pgtblsz);
-	if (pgtbl == NULL)
+	pa = ia64_platform_alloc(0, pgtblsz);
+	if (pa == ~0UL)
 		return (ENOMEM);
+	pgtbl = (void *)pa;
 
 	/* Initialize new page table. */
 	if (ia64_pgtbl != NULL && ia64_pgtbl != pgtbl)
@@ -85,7 +88,7 @@ pgtbl_extend(u_int idx)
 void *
 ia64_va2pa(vm_offset_t va, size_t *len)
 {
-	uint64_t pa;
+	uint64_t pa, pte;
 	u_int idx, ofs;
 	int error;
 
@@ -111,16 +114,18 @@ ia64_va2pa(vm_offset_t va, size_t *len)
 	}
 
 	ofs = va & IA64_PBVM_PAGE_MASK;
-	pa = ia64_pgtbl[idx];
-	if (pa == 0) {
+	pte = ia64_pgtbl[idx];
+	if ((pte & PTE_PRESENT) == 0) {
 		pa = ia64_platform_alloc(va - ofs, IA64_PBVM_PAGE_SIZE);
-		if (pa == 0) {
+		if (pa == ~0UL) {
 			error = ENOMEM;
 			goto fail;
 		}
-		ia64_pgtbl[idx] = pa;
+		pte = PTE_AR_RWX | PTE_DIRTY | PTE_ACCESSED | PTE_PRESENT;
+		pte |= (pa & PTE_PPN_MASK);
+		ia64_pgtbl[idx] = pte;
 	}
-	pa += ofs;
+	pa = (pte & PTE_PPN_MASK) + ofs;
 
 	/* We can not cross page boundaries (in general). */
 	if (*len + ofs > IA64_PBVM_PAGE_SIZE)

Modified: head/sys/boot/ia64/efi/efimd.c
==============================================================================
--- head/sys/boot/ia64/efi/efimd.c	Sat Apr 30 20:14:20 2011	(r221268)
+++ head/sys/boot/ia64/efi/efimd.c	Sat Apr 30 20:16:49 2011	(r221269)
@@ -90,6 +90,10 @@ ia64_efi_memmap_update(void)
 	return (TRUE);
 }
 
+/*
+ * Returns 0 on failure. Successful allocations return an address
+ * larger or equal to IA64_EFI_ALLOC_BOUNDARY.
+ */
 static vm_paddr_t
 ia64_efi_alloc(vm_size_t sz)
 {
@@ -144,11 +148,12 @@ ia64_efi_alloc(vm_size_t sz)
 vm_paddr_t
 ia64_platform_alloc(vm_offset_t va, vm_size_t sz)
 {
+	vm_paddr_t pa;
 
 	if (va == 0) {
 		/* Page table itself. */
 		if (sz > IA64_EFI_PGTBLSZ_MAX)
-			return (0);
+			return (~0UL);
 		if (ia64_efi_pgtbl == 0)
 			ia64_efi_pgtbl = ia64_efi_alloc(IA64_EFI_PGTBLSZ_MAX);
 		if (ia64_efi_pgtbl != 0)
@@ -156,7 +161,7 @@ ia64_platform_alloc(vm_offset_t va, vm_s
 		return (ia64_efi_pgtbl);
 	} else if (va < IA64_PBVM_BASE) {
 		/* Should not happen. */
-		return (0);
+		return (~0UL);
 	}
 
 	/* Loader virtual memory page. */
@@ -169,7 +174,8 @@ ia64_platform_alloc(vm_offset_t va, vm_s
 		return (ia64_efi_chunk + va);
 
 	/* Allocate a page at a time when we go beyond the chunk. */
-	return (ia64_efi_alloc(sz));
+	pa = ia64_efi_alloc(sz);
+	return ((pa == 0) ? ~0UL : pa);
 }
 
 void

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 20:34:53 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D0B5106566B;
	Sat, 30 Apr 2011 20:34:53 +0000 (UTC)
	(envelope-from thompsa@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0A1428FC14;
	Sat, 30 Apr 2011 20:34:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UKYqT6061269;
	Sat, 30 Apr 2011 20:34:52 GMT (envelope-from thompsa@svn.freebsd.org)
Received: (from thompsa@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UKYqOq061267;
	Sat, 30 Apr 2011 20:34:52 GMT (envelope-from thompsa@svn.freebsd.org)
Message-Id: <201104302034.p3UKYqOq061267@svn.freebsd.org>
From: Andrew Thompson 
Date: Sat, 30 Apr 2011 20:34:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221270 - head/sys/net
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 20:34:53 -0000

Author: thompsa
Date: Sat Apr 30 20:34:52 2011
New Revision: 221270
URL: http://svn.freebsd.org/changeset/base/221270

Log:
  LACP frames must not be send VLAN-tagged, check for that before processing.
  
  PR:		kern/156743
  Submitted by:	Dmitrij Tejblum
  MFC after:	1 week

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==============================================================================
--- head/sys/net/if_lagg.c	Sat Apr 30 20:16:49 2011	(r221269)
+++ head/sys/net/if_lagg.c	Sat Apr 30 20:34:52 2011	(r221270)
@@ -1794,7 +1794,7 @@ lagg_lacp_input(struct lagg_softc *sc, s
 	etype = ntohs(eh->ether_type);
 
 	/* Tap off LACP control messages */
-	if (etype == ETHERTYPE_SLOW) {
+	if ((m->m_flags & M_VLANTAG) == 0 && etype == ETHERTYPE_SLOW) {
 		m = lacp_input(lp, m);
 		if (m == NULL)
 			return (NULL);

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 20:49:01 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E810106564A;
	Sat, 30 Apr 2011 20:49:01 +0000 (UTC)
	(envelope-from marcel@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 49DB28FC0A;
	Sat, 30 Apr 2011 20:49:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UKn1WO061699;
	Sat, 30 Apr 2011 20:49:01 GMT (envelope-from marcel@svn.freebsd.org)
Received: (from marcel@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UKn1GO061687;
	Sat, 30 Apr 2011 20:49:01 GMT (envelope-from marcel@svn.freebsd.org)
Message-Id: <201104302049.p3UKn1GO061687@svn.freebsd.org>
From: Marcel Moolenaar 
Date: Sat, 30 Apr 2011 20:49:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221271 - in head/sys: conf ia64/ia64 ia64/include
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 20:49:01 -0000

Author: marcel
Date: Sat Apr 30 20:49:00 2011
New Revision: 221271
URL: http://svn.freebsd.org/changeset/base/221271

Log:
  Stop linking against a direct-mapped virtual address and instead
  use the PBVM. This eliminates the implied hardcoding of the
  physical address at which the kernel needs to be loaded. Using the
  PBVM makes it possible to load the kernel irrespective of the
  physical memory organization and allows us to replicate kernel text
  on NUMA machines.
  
  While here, reduce the direct-mapped page size to the kernel's
  page size so that we can support memory attributes better.

Added:
  head/sys/ia64/ia64/mp_locore.S   (contents, props changed)
Modified:
  head/sys/conf/files.ia64
  head/sys/conf/ldscript.ia64
  head/sys/ia64/ia64/efi.c
  head/sys/ia64/ia64/exception.S
  head/sys/ia64/ia64/genassym.c
  head/sys/ia64/ia64/locore.S
  head/sys/ia64/ia64/machdep.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/ia64/pmap.c
  head/sys/ia64/ia64/sal.c
  head/sys/ia64/include/ia64_cpu.h
  head/sys/ia64/include/smp.h
  head/sys/ia64/include/vmparam.h

Modified: head/sys/conf/files.ia64
==============================================================================
--- head/sys/conf/files.ia64	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/conf/files.ia64	Sat Apr 30 20:49:00 2011	(r221271)
@@ -92,6 +92,7 @@ ia64/ia64/locore.S		standard	no-obj
 ia64/ia64/machdep.c		standard
 ia64/ia64/mca.c			standard
 ia64/ia64/mem.c			optional	mem
+ia64/ia64/mp_locore.S		optional	smp
 ia64/ia64/mp_machdep.c		optional	smp
 ia64/ia64/nexus.c		standard
 ia64/ia64/pal.S			standard

Modified: head/sys/conf/ldscript.ia64
==============================================================================
--- head/sys/conf/ldscript.ia64	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/conf/ldscript.ia64	Sat Apr 30 20:49:00 2011	(r221271)
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf64-ia64-freebsd", "elf
 OUTPUT_ARCH(ia64)
 ENTRY(__start)
 SEARCH_DIR(/usr/lib);
-kernel_text = 0xe000000004000000;
+kernel_text = 0x9ffc000000000000;
 SECTIONS
 {
   /* Read-only sections, merged into text segment: */
@@ -11,10 +11,10 @@ SECTIONS
   .interp         : { *(.interp) }
 
   PROVIDE (btext = .);
-  .ivt		  : { *(.ivt) }
   .text           :
   {
-    *(.text.ivt)
+    *(.ivt)
+    *(.ivt.text)
     *(.text .stub .text.* .gnu.linkonce.t.*)
     /* .gnu.warning sections are handled specially by elf32.em.  */
     *(.gnu.warning)
@@ -60,9 +60,11 @@ SECTIONS
      page in the loader virtual memory. */
   . = ALIGN(65536);
 
+  PROVIDE (bdata = .);
   .data           :
   {
-    *(.data.kstack .data .data.* .gnu.linkonce.d.*)
+    *(.ivt.data)
+    *(.data .data.* .gnu.linkonce.d.*)
     SORT(CONSTRUCTORS)
   }
   .data1          : { *(.data1) }

Modified: head/sys/ia64/ia64/efi.c
==============================================================================
--- head/sys/ia64/ia64/efi.c	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/ia64/ia64/efi.c	Sat Apr 30 20:49:00 2011	(r221271)
@@ -129,7 +129,7 @@ efi_boot_minimal(uint64_t systbl)
 	setvirt = (void *)IA64_PHYS_TO_RR7((u_long)efi_runtime->rt_setvirtual);
 	status = ia64_efi_physical(setvirt, bootinfo->bi_memmap_size,
 	    bootinfo->bi_memdesc_size, bootinfo->bi_memdesc_version,
-	    bootinfo->bi_memmap);
+	    ia64_tpa(bootinfo->bi_memmap));
 	return ((status < 0) ? EFAULT : 0);
 }
 
@@ -164,7 +164,7 @@ efi_md_first(void)
 
 	if (bootinfo->bi_memmap == 0)
 		return (NULL);
-	return ((struct efi_md *)IA64_PHYS_TO_RR7(bootinfo->bi_memmap));
+	return ((struct efi_md *)bootinfo->bi_memmap);
 }
 
 struct efi_md *
@@ -172,7 +172,7 @@ efi_md_next(struct efi_md *md)
 {
 	uint64_t plim;
 
-	plim = IA64_PHYS_TO_RR7(bootinfo->bi_memmap + bootinfo->bi_memmap_size);
+	plim = bootinfo->bi_memmap + bootinfo->bi_memmap_size;
 	md = (struct efi_md *)((uintptr_t)md + bootinfo->bi_memdesc_size);
 	return ((md >= (struct efi_md *)plim) ? NULL : md);
 }

Modified: head/sys/ia64/ia64/exception.S
==============================================================================
--- head/sys/ia64/ia64/exception.S	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/ia64/ia64/exception.S	Sat Apr 30 20:49:00 2011	(r221271)
@@ -48,9 +48,16 @@ __FBSDID("$FreeBSD$");
  * ar.k4 = PCPU data
  */
 
+	.section .ivt.data, "aw"
+
+	.global pmap_ptc_g_sem
+pmap_ptc_g_sem:	data8	0
+
+	.global ia64_kptdir
+ia64_kptdir:	data8	0
+
 #ifdef EXCEPTION_TRACING
 
-	.data
 	.global xtrace, xhead
 xtrace:	.space	1024*5*8
 xhead:	data8	xtrace
@@ -101,7 +108,7 @@ xhead:	data8	xtrace
 
 #endif
 
-	.section .text.ivt, "ax"
+	.section .ivt.text, "ax"
 
 /*
  * exception_save: save interrupted state
@@ -129,7 +136,7 @@ ENTRY_NOPROFILE(exception_save, 0)
 	;;
 }
 {	.mmi
-	cmp.le		p14,p15=5,r31
+	cmp.le		p14,p15=IA64_VM_MINKERN_REGION,r31
 	;;
 (p15)	mov		r23=ar.k7		// kernel memory stack
 (p14)	mov		r23=sp
@@ -233,7 +240,7 @@ exception_save_restart:
 {	.mmi
 	st8		[r30]=r19,16		// rnat
 	st8		[r31]=r0,16		// __spare
-	cmp.le		p12,p13=5,r24
+	cmp.le		p12,p13=IA64_VM_MINKERN_REGION,r24
 	;;
 }
 {	.mmi
@@ -602,7 +609,7 @@ ENTRY_NOPROFILE(exception_restore, 0)
 {	.mmi
 	ld8.fill	r1=[r30],16		// gp
 	ld8		r27=[r31],16		// ndirty
-	cmp.le		p14,p15=5,r28
+	cmp.le		p14,p15=IA64_VM_MINKERN_REGION,r28
 	;;
 }
 {	.mmi
@@ -915,7 +922,7 @@ IVT_ENTRY(Alternate_Instruction_TLB, 0x0
 	extr.u	r17=r16,61,3		// get region number
 	mov	r19=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX
 	;;
-	cmp.eq	p13,p0=4,r17		// RR4?
+	cmp.eq	p13,p0=IA64_PBVM_RR,r17		// RR4?
 (p13)	br.cond.sptk.few	4f
 	;;
 	cmp.ge	p13,p0=5,r17		// RR0-RR5?
@@ -958,7 +965,7 @@ IVT_ENTRY(Alternate_Data_TLB, 0x1000)
 	extr.u	r17=r16,61,3		// get region number
 	mov	r19=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX
 	;;
-	cmp.eq	p13,p0=4,r17		// RR4?
+	cmp.eq	p13,p0=IA64_PBVM_RR,r17		// RR4?
 (p13)	br.cond.sptk.few	4f
 	;;
 	cmp.ge	p13,p0=5,r17		// RR0-RR5?
@@ -1007,21 +1014,22 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400)
 	// double nested faults. Since all virtual addresses we encounter
 	// here are direct mapped region 7 addresses, we have no problem
 	// constructing physical addresses.
+
 {	.mlx
-	rsm		psr.dt
+	nop		0
 	movl		r27=ia64_kptdir
 	;;
 }
 {	.mii
-	srlz.d
-	dep		r27=0,r27,61,3
-	;;
+	ld8		r27=[r27]
 	extr.u		r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3	// dir L0 index
-}
-{	.mii
-	ld8		r27=[r27]				// dir L0 page
 	extr.u		r26=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3	// dir L1 index
 	;;
+}
+{	.mmi
+	rsm		psr.dt
+	;;
+	srlz.d
 	dep		r27=0,r27,61,3
 	;;
 }

Modified: head/sys/ia64/ia64/genassym.c
==============================================================================
--- head/sys/ia64/ia64/genassym.c	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/ia64/ia64/genassym.c	Sat Apr 30 20:49:00 2011	(r221271)
@@ -77,13 +77,13 @@ ASSYM(ERESTART,		ERESTART);
 
 ASSYM(FRAME_SYSCALL,	FRAME_SYSCALL);
 
-ASSYM(IA64_ID_PAGE_SHIFT, IA64_ID_PAGE_SHIFT);
-
 ASSYM(IA64_PBVM_BASE,	IA64_PBVM_BASE);
 ASSYM(IA64_PBVM_PAGE_SHIFT, IA64_PBVM_PAGE_SHIFT);
 ASSYM(IA64_PBVM_PGTBL,	IA64_PBVM_PGTBL);
 ASSYM(IA64_PBVM_RR,	IA64_PBVM_RR);
 
+ASSYM(IA64_VM_MINKERN_REGION, IA64_VM_MINKERN_REGION);
+
 ASSYM(KSTACK_PAGES,	KSTACK_PAGES);
 
 ASSYM(MC_PRESERVED,	offsetof(mcontext_t, mc_preserved));

Modified: head/sys/ia64/ia64/locore.S
==============================================================================
--- head/sys/ia64/ia64/locore.S	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/ia64/ia64/locore.S	Sat Apr 30 20:49:00 2011	(r221271)
@@ -1,4 +1,5 @@
 /*-
+ * Copyright (c) 2001-2011 Marcel Moolenaar
  * Copyright (c) 1998 Doug Rabson
  * All rights reserved.
  *
@@ -26,12 +27,10 @@
  * $FreeBSD$
  */
 
-#include 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
 
 /*
@@ -40,7 +39,7 @@
  */
 #define	FW_STACK_SIZE	3*PAGE_SIZE
 
-	.section .data.kstack, "aw"
+	.section .ivt.data, "aw"
 	.align	PAGE_SIZE
 	.global	kstack
 kstack:	.space	FW_STACK_SIZE
@@ -82,7 +81,7 @@ ENTRY_NOPROFILE(__start, 1)
 }
 {	.mlx
 	mov	ar.bspstore=r16		// switch backing store
-	movl	r16=pa_bootinfo
+	movl	r16=bootinfo
 	;;
 }
 {	.mmi
@@ -187,124 +186,6 @@ enter_userland:
 }
 END(fork_trampoline)
 
-#ifdef SMP
-/*
- * AP wake-up entry point. The handoff state is similar as for the BSP,
- * as described on page 3-9 of the IPF SAL Specification. The difference
- * lies in the contents of register b0. For APs this register holds the
- * return address into the SAL rendezvous routine.
- *
- * Note that we're responsible for clearing the IRR bit by reading cr.ivr
- * and issuing the EOI to the local SAPIC.
- */
-	.align	32
-ENTRY_NOPROFILE(os_boot_rendez,0)
-	mov	r16=cr.ivr	// clear IRR bit
-	;;
-	srlz.d
-	mov	cr.eoi=r0	// ACK the wake-up
-	;;
-	srlz.d
-	rsm	IA64_PSR_IC|IA64_PSR_I
-	;;
-	mov	r16 = (5<<8)|(PAGE_SHIFT<<2)|1
-	movl	r17 = 5<<61
-	;;
-	mov	rr[r17] = r16
-	;;
-	srlz.d
-	mov	r16 = (6<<8)|(IA64_ID_PAGE_SHIFT<<2)
-	movl	r17 = 6<<61
-	;;
-	mov	rr[r17] = r16
-	;;
-	srlz.d
-	mov	r16 = (7<<8)|(IA64_ID_PAGE_SHIFT<<2)
-	movl	r17 = 7<<61
-	;;
-	mov	rr[r17] = r16
-	;;
-	srlz.d
-	mov	r18 = 28<<2
-	movl	r16 = PTE_PRESENT+PTE_MA_WB+PTE_ACCESSED+PTE_DIRTY+ \
-			PTE_PL_KERN+PTE_AR_RWX+PTE_ED
-	;;
-	mov	cr.ifa = r17
-	mov	cr.itir = r18
-	ptr.d	r17, r18
-	ptr.i	r17, r18
-	;;
-	srlz.i
-	;;
-	itr.d	dtr[r0] = r16
-	mov	r18 = IA64_DCR_DEFAULT
-	;;
-	itr.i	itr[r0] = r16
-	mov	cr.dcr = r18
-	;;
-	srlz.i
-	;;
-1:	mov	r16 = ip
-	add	r17 = 2f-1b, r17
-	movl	r18 = (IA64_PSR_AC|IA64_PSR_BN|IA64_PSR_DFH|IA64_PSR_DT|IA64_PSR_IC|IA64_PSR_IT|IA64_PSR_RT)
-	;;
-	add	r17 = r17, r16
-	mov	cr.ipsr = r18
-	mov	cr.ifs = r0
-	;;
-	mov	cr.iip = r17
-	;;
-	rfi
-
-	.align	32
-2:
-{	.mlx
-	mov	ar.rsc = 0
-	movl	r16 = ia64_vector_table			// set up IVT early
-	;;
-}
-{	.mlx
-	mov	cr.iva = r16
-	movl	r16 = ap_stack
-	;;
-}
-{	.mmi
-	srlz.i
-	;;
-	ld8	r16 = [r16]
-	mov	r18 = KSTACK_PAGES*PAGE_SIZE-SIZEOF_PCB-SIZEOF_TRAPFRAME-16
-	;;
-}
-{	.mlx
-	mov	ar.bspstore = r16
-	movl	gp = __gp
-	;;
-}
-{	.mmi
-	loadrs
-	;;
-	alloc	r17 = ar.pfs, 0, 0, 0, 0
-	add	sp = r18, r16
-	;;
-}
-{	.mib
-	mov	ar.rsc = 3
-	nop	0
-	br.call.sptk.few rp = ia64_ap_startup
-	;;
-}
-	/* NOT REACHED */
-9:
-{	.mib
-	nop	0
-	nop	0
-	br.sptk	9b
-	;;
-}
-END(os_boot_rendez)
-
-#endif /* !SMP */
-
 /*
  * Create a default interrupt name table. The first entry (vector 0) is
  * hardwaired to the clock interrupt.

Modified: head/sys/ia64/ia64/machdep.c
==============================================================================
--- head/sys/ia64/ia64/machdep.c	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/ia64/ia64/machdep.c	Sat Apr 30 20:49:00 2011	(r221271)
@@ -115,7 +115,6 @@ SYSCTL_UINT(_hw_freq, OID_AUTO, itc, CTL
 
 int cold = 1;
 
-u_int64_t pa_bootinfo;
 struct bootinfo *bootinfo;
 
 struct pcpu pcpu0;
@@ -128,8 +127,9 @@ extern u_int64_t epc_sigtramp[];
 
 struct fpswa_iface *fpswa_iface;
 
-u_int64_t ia64_pal_base;
-u_int64_t ia64_port_base;
+vm_size_t ia64_pal_size;
+vm_paddr_t ia64_pal_base;
+vm_offset_t ia64_port_base;
 
 u_int64_t ia64_lapic_addr = PAL_PIB_DEFAULT_ADDR;
 
@@ -548,15 +548,15 @@ map_vhpt(uintptr_t vhpt)
 	pte |= vhpt & PTE_PPN_MASK;
 
 	__asm __volatile("ptr.d %0,%1" :: "r"(vhpt),
-	    "r"(IA64_ID_PAGE_SHIFT<<2));
+	    "r"(pmap_vhpt_log2size << 2));
 
 	__asm __volatile("mov   %0=psr" : "=r"(psr));
 	__asm __volatile("rsm   psr.ic|psr.i");
 	ia64_srlz_i();
 	ia64_set_ifa(vhpt);
-	ia64_set_itir(IA64_ID_PAGE_SHIFT << 2);
+	ia64_set_itir(pmap_vhpt_log2size << 2);
 	ia64_srlz_d();
-	__asm __volatile("itr.d dtr[%0]=%1" :: "r"(2), "r"(pte));
+	__asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte));
 	__asm __volatile("mov   psr.l=%0" :: "r" (psr));
 	ia64_srlz_i();
 }
@@ -565,25 +565,36 @@ void
 map_pal_code(void)
 {
 	pt_entry_t pte;
+	vm_offset_t va;
+	vm_size_t sz;
 	uint64_t psr;
+	u_int shft;
 
-	if (ia64_pal_base == 0)
+	if (ia64_pal_size == 0)
 		return;
 
+	va = IA64_PHYS_TO_RR7(ia64_pal_base);
+
+	sz = ia64_pal_size;
+	shft = 0;
+	while (sz > 1) {
+		shft++;
+		sz >>= 1;
+	}
+
 	pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
 	    PTE_PL_KERN | PTE_AR_RWX;
 	pte |= ia64_pal_base & PTE_PPN_MASK;
 
-	__asm __volatile("ptr.d %0,%1; ptr.i %0,%1" ::
-	    "r"(IA64_PHYS_TO_RR7(ia64_pal_base)), "r"(IA64_ID_PAGE_SHIFT<<2));
+	__asm __volatile("ptr.d %0,%1; ptr.i %0,%1" :: "r"(va), "r"(shft<<2));
 
 	__asm __volatile("mov	%0=psr" : "=r"(psr));
 	__asm __volatile("rsm	psr.ic|psr.i");
 	ia64_srlz_i();
-	ia64_set_ifa(IA64_PHYS_TO_RR7(ia64_pal_base));
-	ia64_set_itir(IA64_ID_PAGE_SHIFT << 2);
+	ia64_set_ifa(va);
+	ia64_set_itir(shft << 2);
 	ia64_srlz_d();
-	__asm __volatile("itr.d	dtr[%0]=%1" :: "r"(1), "r"(pte));
+	__asm __volatile("itr.d	dtr[%0]=%1" :: "r"(4), "r"(pte));
 	ia64_srlz_d();
 	__asm __volatile("itr.i	itr[%0]=%1" :: "r"(1), "r"(pte));
 	__asm __volatile("mov	psr.l=%0" :: "r" (psr));
@@ -598,7 +609,7 @@ map_gateway_page(void)
 
 	pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
 	    PTE_PL_KERN | PTE_AR_X_RX;
-	pte |= (uint64_t)ia64_gateway_page & PTE_PPN_MASK;
+	pte |= ia64_tpa((uint64_t)ia64_gateway_page) & PTE_PPN_MASK;
 
 	__asm __volatile("ptr.d %0,%1; ptr.i %0,%1" ::
 	    "r"(VM_MAXUSER_ADDRESS), "r"(PAGE_SHIFT << 2));
@@ -609,9 +620,9 @@ map_gateway_page(void)
 	ia64_set_ifa(VM_MAXUSER_ADDRESS);
 	ia64_set_itir(PAGE_SHIFT << 2);
 	ia64_srlz_d();
-	__asm __volatile("itr.d	dtr[%0]=%1" :: "r"(3), "r"(pte));
+	__asm __volatile("itr.d	dtr[%0]=%1" :: "r"(5), "r"(pte));
 	ia64_srlz_d();
-	__asm __volatile("itr.i	itr[%0]=%1" :: "r"(3), "r"(pte));
+	__asm __volatile("itr.i	itr[%0]=%1" :: "r"(2), "r"(pte));
 	__asm __volatile("mov	psr.l=%0" :: "r" (psr));
 	ia64_srlz_i();
 
@@ -681,17 +692,6 @@ ia64_init(void)
 	 */
 
 	/*
-	 * pa_bootinfo is the physical address of the bootinfo block as
-	 * passed to us by the loader and set in locore.s.
-	 */
-	bootinfo = (struct bootinfo *)(IA64_PHYS_TO_RR7(pa_bootinfo));
-
-	if (bootinfo->bi_magic != BOOTINFO_MAGIC || bootinfo->bi_version != 1) {
-		bzero(bootinfo, sizeof(*bootinfo));
-		bootinfo->bi_kernend = (vm_offset_t)round_page(_end);
-	}
-
-	/*
 	 * Look for the I/O ports first - we need them for console
 	 * probing.
 	 */
@@ -702,6 +702,7 @@ ia64_init(void)
 			    md->md_pages * EFI_PAGE_SIZE);
 			break;
 		case EFI_MD_TYPE_PALCODE:
+			ia64_pal_size = md->md_pages * EFI_PAGE_SIZE;
 			ia64_pal_base = md->md_phys;
 			break;
 		}
@@ -742,6 +743,25 @@ ia64_init(void)
 		kernend = round_page(bootinfo->bi_kernend);
 
 	/*
+	 * Region 6 is direct mapped UC and region 7 is direct mapped
+	 * WC. The details of this is controlled by the Alt {I,D}TLB
+	 * handlers. Here we just make sure that they have the largest
+	 * possible page size to minimise TLB usage.
+	 */
+	ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2));
+	ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2));
+	ia64_srlz_d();
+
+	/*
+	 * Wire things up so we can call the firmware.
+	 */
+	map_pal_code();
+	efi_boot_minimal(bootinfo->bi_systab);
+	ia64_xiv_init();
+	ia64_sal_init();
+	calculate_frequencies();
+
+	/*
 	 * Setup the PCPU data for the bootstrap processor. It is needed
 	 * by printf(). Also, since printf() has critical sections, we
 	 * need to initialize at least pc_curthread.
@@ -750,6 +770,7 @@ ia64_init(void)
 	ia64_set_k4((u_int64_t)pcpup);
 	pcpu_init(pcpup, 0, sizeof(pcpu0));
 	dpcpu_init((void *)kernend, 0);
+	PCPU_SET(md.lid, ia64_get_lid());
 	kernend += DPCPU_SIZE;
 	PCPU_SET(curthread, &thread0);
 
@@ -760,26 +781,6 @@ ia64_init(void)
 
 	/* OUTPUT NOW ALLOWED */
 
-	if (ia64_pal_base != 0) {
-		ia64_pal_base &= ~IA64_ID_PAGE_MASK;
-		/*
-		 * We use a TR to map the first 256M of memory - this might
-		 * cover the palcode too.
-		 */
-		if (ia64_pal_base == 0)
-			printf("PAL code mapped by the kernel's TR\n");
-	} else
-		printf("PAL code not found\n");
-
-	/*
-	 * Wire things up so we can call the firmware.
-	 */
-	map_pal_code();
-	efi_boot_minimal(bootinfo->bi_systab);
-	ia64_xiv_init();
-	ia64_sal_init();
-	calculate_frequencies();
-
 	if (metadata_missing)
 		printf("WARNING: loader(8) metadata is missing!\n");
 

Added: head/sys/ia64/ia64/mp_locore.S
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/ia64/ia64/mp_locore.S	Sat Apr 30 20:49:00 2011	(r221271)
@@ -0,0 +1,275 @@
+/*-
+ * Copyright (c) 2011 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * AP wake-up entry point. The handoff state is similar as for the BSP,
+ * as described on page 3-9 of the IPF SAL Specification. The difference
+ * lies in the contents of register b0. For APs this register holds the
+ * return address into the SAL rendezvous routine.
+ *
+ * Note that we're responsible for clearing the IRR bit by reading cr.ivr
+ * and issuing the EOI to the local SAPIC.
+ */
+	.align	32
+ENTRY_NOPROFILE(os_boot_rendez,0)
+{	.mmi
+	st8	[gp] = gp		// trace = 0x00
+	mov	r8 = cr.ivr		// clear IRR bit
+	add	r2 = 8, gp
+	;;
+}
+{	.mmi
+	srlz.d
+	mov	cr.eoi = r0		// ACK the wake-up
+	add	r3 = 16, gp
+	;;
+}
+{	.mmi
+	srlz.d
+	rsm	IA64_PSR_IC | IA64_PSR_I
+	mov	r16 = (IA64_PBVM_RR << 8) | (IA64_PBVM_PAGE_SHIFT << 2)
+	;;
+}
+{	.mmi
+	srlz.d
+	st8	[gp] = r2		// trace = 0x08
+	dep.z	r17 = IA64_PBVM_RR, 61, 3
+	;;
+}
+{	.mlx
+	mov     rr[r17] = r16
+	movl	r18 = IA64_PBVM_PGTBL
+	;;
+}
+{	.mmi
+	srlz.i
+	;;
+	st8	[gp] = r3		// trace = 0x10
+	nop	0
+	;;
+}
+{	.mmi
+	ld8	r16 = [r2], 16		// as_pgtbl_pte
+	ld8	r17 = [r3], 16		// as_pgtbl_itir
+	nop	0
+	;;
+}
+{	.mmi
+	mov	cr.itir = r17
+	mov	cr.ifa = r18
+	nop	0
+	;;
+}
+{	.mmi
+	srlz.d
+	ptr.d	r18, r17
+	nop	0
+	;;
+}
+{	.mmi
+	srlz.d
+	st8	[gp] = r2		// trace = 0x18
+	mov	r8 = r0
+	;;
+}
+{	.mmi
+	itr.d	dtr[r8] = r16
+	;;
+	srlz.d
+	mov	r9 = r0
+	;;
+}
+{	.mmi
+	ld8	r16 = [r2], 16		// as_text_va
+	st8	[gp] = r3		// trace = 0x20
+	add	r8 = 1, r8
+	;;
+}
+{	.mmi
+	ld8	r17 = [r3], 16		// as_text_pte
+	ld8	r18 = [r2], 16		// as_text_itir
+	nop	0
+	;;
+}
+{	.mmi
+	mov	cr.ifa = r16
+	mov	cr.itir = r18
+	nop	0
+	;;
+}
+{	.mmi
+	srlz.d
+	ptr.d	r16, r18
+	nop	0
+	;;
+}
+{	.mmi
+	srlz.d
+	st8	[gp] = r3		// trace = 0x30
+	nop	0
+	;;
+}
+{	.mmi
+	itr.d	dtr[r8] = r17
+	;;
+	srlz.d
+	nop	0
+}
+{	.mmi
+	st8	[gp] = r2		// trace = 0x38
+	ptr.i	r16, r18
+	add	r8 = 1, r8
+	;;
+}
+{	.mmi
+	srlz.i
+	;;
+	itr.i	itr[r9] = r17
+	nop	0
+	;;
+}
+{	.mmi
+	srlz.i
+	;;
+	ld8	r16 = [r3], 16          // as_data_va
+	add	r9 = 1, r9
+	;;
+}
+{	.mmi
+	st8	[gp] = r3		// trace = 0x40
+	ld8	r17 = [r2], 16		// as_data_pte
+	nop	0
+	;;
+}
+{	.mmi
+	mov	cr.ifa = r16
+	ld8	r18 = [r3], 16		// as_data_itir
+	nop	0
+	;;
+}
+{	.mmi
+	mov	cr.itir = r18
+	;;
+	srlz.d
+	nop	0
+	;;
+}
+{	.mmi
+	ptr.d	r16, r18
+	;;
+	srlz.d
+	mov	r19 = IA64_DCR_DEFAULT
+	;;
+}
+{	.mmi
+	itr.d	dtr[r8] = r17
+	;;
+	srlz.d
+	add	r8 = 1, r8
+	;;
+}
+{	.mmi
+	st8	[gp] = r2		// trace = 0x48
+	;;
+	ld8	r16 = [r2], 16		// as_kstack
+	nop	0
+}
+{	.mmi
+	ld8	r17 = [r3], 16		// as_kstack_top
+	mov	cr.dcr = r19
+	nop	0
+	;;
+}
+{	.mlx
+	srlz.i
+	movl	r18 = IA64_PSR_BN | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_IC | \
+			IA64_PSR_RT | IA64_PSR_DFH
+	;;
+}
+{	.mlx
+	mov	cr.ipsr = r18
+	movl	r19 = ia64_vector_table		// set up IVT early
+	;;
+}
+{	.mlx
+	mov	cr.iva = r19
+	movl	r18 = 1f
+	;;
+}
+{	.mmi
+	mov	cr.iip = r18
+	mov	cr.ifs = r0
+	nop	0
+	;;
+}
+{	.mmb
+	srlz.d
+	st8	[gp] = r2		// trace = 0x58
+	rfi
+	;;
+}
+
+	.align	32
+1:
+{	.mlx
+	mov	ar.bspstore = r16
+	movl	gp = __gp
+	;;
+}
+{	.mmi
+	loadrs
+	add	sp = -16, r17
+	nop	0
+	;;
+}
+{	.mmi
+	mov	ar.rsc = 3
+	;;
+	alloc	r18 = ar.pfs, 0, 0, 0, 0
+	;;
+}
+{	.mib
+	nop	0
+	nop	0
+	br.call.sptk.few rp = ia64_ap_startup
+	;;
+}
+	/* NOT REACHED */
+9:
+{	.mib
+	nop	0
+	nop	0
+	br.sptk	9b
+	;;
+}
+END(os_boot_rendez)

Modified: head/sys/ia64/ia64/mp_machdep.c
==============================================================================
--- head/sys/ia64/ia64/mp_machdep.c	Sat Apr 30 20:34:52 2011	(r221270)
+++ head/sys/ia64/ia64/mp_machdep.c	Sat Apr 30 20:49:00 2011	(r221271)
@@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -62,22 +63,18 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+extern uint64_t bdata[];
+
 MALLOC_DEFINE(M_SMP, "SMP", "SMP related allocations");
 
 void ia64_ap_startup(void);
 
-#define	LID_SAPIC(x)		((u_int)((x) >> 16))
-#define	LID_SAPIC_ID(x)		((u_int)((x) >> 24) & 0xff)
-#define	LID_SAPIC_EID(x)	((u_int)((x) >> 16) & 0xff)
-#define	LID_SAPIC_SET(id,eid)	(((id & 0xff) << 8 | (eid & 0xff)) << 16);
-#define	LID_SAPIC_MASK		0xffff0000UL
-
-/* Variables used by os_boot_rendez and ia64_ap_startup */
-struct pcpu *ap_pcpu;
-void *ap_stack;
-volatile int ap_delay;
-volatile int ap_awake;
-volatile int ap_spin;
+#define	SAPIC_ID_GET_ID(x)	((u_int)((x) >> 8) & 0xff)
+#define	SAPIC_ID_GET_EID(x)	((u_int)(x) & 0xff)
+#define	SAPIC_ID_SET(id, eid)	((u_int)(((id) & 0xff) << 8) | ((eid) & 0xff))
+
+/* State used to wake and bootstrap APs. */
+struct ia64_ap_state ia64_ap_state;
 
 int ia64_ipi_ast;
 int ia64_ipi_highfp;
@@ -87,6 +84,21 @@ int ia64_ipi_rndzvs;
 int ia64_ipi_stop;
 
 static u_int
+sz2shft(uint64_t sz)
+{
+	uint64_t s;
+	u_int shft;
+
+	shft = 12;      /* Start with 4K */
+	s = 1 << shft;
+	while (s < sz) {
+		shft++;
+		s <<= 1;
+	}
+	return (shft);
+}
+
+static u_int
 ia64_ih_ast(struct thread *td, u_int xiv, struct trapframe *tf)
 {
 
@@ -180,16 +192,27 @@ ia64_ap_startup(void)
 {
 	uint64_t vhpt;
 
-	pcpup = ap_pcpu;
+	ia64_ap_state.as_trace = 0x100;
+
+	ia64_set_rr(IA64_RR_BASE(5), (5 << 8) | (PAGE_SHIFT << 2) | 1);
+	ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2));
+	ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2));
+	ia64_srlz_d();
+
+	pcpup = ia64_ap_state.as_pcpu;
 	ia64_set_k4((intptr_t)pcpup);
 
+	ia64_ap_state.as_trace = 0x108;
+
 	vhpt = PCPU_GET(md.vhpt);
 	map_vhpt(vhpt);
 	ia64_set_pta(vhpt + (1 << 8) + (pmap_vhpt_log2size << 2) + 1);
 	ia64_srlz_i();
 
-	ap_awake = 1;
-	ap_delay = 0;
+	ia64_ap_state.as_trace = 0x110;
+
+	ia64_ap_state.as_awake = 1;
+	ia64_ap_state.as_delay = 0;
 
 	map_pal_code();
 	map_gateway_page();
@@ -197,14 +220,14 @@ ia64_ap_startup(void)
 	ia64_set_fpsr(IA64_FPSR_DEFAULT);
 
 	/* Wait until it's time for us to be unleashed */
-	while (ap_spin)
+	while (ia64_ap_state.as_spin)
 		cpu_spinwait();
 
 	/* Initialize curthread. */
 	KASSERT(PCPU_GET(idlethread) != NULL, ("no idle thread"));
 	PCPU_SET(curthread, PCPU_GET(idlethread));
 
-	atomic_add_int(&ap_awake, 1);
+	atomic_add_int(&ia64_ap_state.as_awake, 1);
 	while (!smp_started)
 		cpu_spinwait();
 
@@ -253,18 +276,18 @@ cpu_mp_probe(void)
 }
 
 void
-cpu_mp_add(u_int acpiid, u_int apicid, u_int apiceid)
+cpu_mp_add(u_int acpi_id, u_int id, u_int eid)
 {
 	struct pcpu *pc;
-	u_int64_t lid;
 	void *dpcpu;
-	u_int cpuid;
+	u_int cpuid, sapic_id;
 
-	lid = LID_SAPIC_SET(apicid, apiceid);
-	cpuid = ((ia64_get_lid() & LID_SAPIC_MASK) == lid) ? 0 : smp_cpus++;
+	sapic_id = SAPIC_ID_SET(id, eid);
+	cpuid = (IA64_LID_GET_SAPIC_ID(ia64_get_lid()) == sapic_id)
+	    ? 0 : smp_cpus++;
 
 	KASSERT((all_cpus & (1UL << cpuid)) == 0,
-	    ("%s: cpu%d already in CPU map", __func__, acpiid));
+	    ("%s: cpu%d already in CPU map", __func__, acpi_id));
 
 	if (cpuid != 0) {
 		pc = (struct pcpu *)malloc(sizeof(*pc), M_SMP, M_WAITOK);
@@ -274,23 +297,26 @@ cpu_mp_add(u_int acpiid, u_int apicid, u
 	} else
 		pc = pcpup;
 
-	pc->pc_acpi_id = acpiid;
-	pc->pc_md.lid = lid;
-	all_cpus |= (1UL << cpuid);
+	pc->pc_acpi_id = acpi_id;
+	pc->pc_md.lid = IA64_LID_SET_SAPIC_ID(sapic_id);
+
+	all_cpus |= (1UL << pc->pc_cpuid);
 }
 
 void
 cpu_mp_announce()
 {
 	struct pcpu *pc;
+	uint32_t sapic_id;
 	int i;
 
 	for (i = 0; i <= mp_maxid; i++) {
 		pc = pcpu_find(i);
 		if (pc != NULL) {
+			sapic_id = IA64_LID_GET_SAPIC_ID(pc->pc_md.lid);
 			printf("cpu%d: ACPI Id=%x, SAPIC Id=%x, SAPIC Eid=%x",
-			    i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_md.lid),
-			    LID_SAPIC_EID(pc->pc_md.lid));
+			    i, pc->pc_acpi_id, SAPIC_ID_GET_ID(sapic_id),
+			    SAPIC_ID_GET_EID(sapic_id));
 			if (i == 0)
 				printf(" (BSP)\n");
 			else

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 22:46:02 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 973E6106566C;
	Sat, 30 Apr 2011 22:46:02 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 82FAF8FC0A;
	Sat, 30 Apr 2011 22:46:02 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UMk285065659;
	Sat, 30 Apr 2011 22:46:02 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UMk27N065657;
	Sat, 30 Apr 2011 22:46:02 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201104302246.p3UMk27N065657@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 30 Apr 2011 22:46:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221281 - head/sys/ufs/ffs
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 22:46:02 -0000

Author: kib
Date: Sat Apr 30 22:46:02 2011
New Revision: 221281
URL: http://svn.freebsd.org/changeset/base/221281

Log:
  Fix typos.
  
  Noted by:	Fabian Keil 
  Pointy hat to:	kib
  MFC after:	1 week

Modified:
  head/sys/ufs/ffs/ffs_vnops.c

Modified: head/sys/ufs/ffs/ffs_vnops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vnops.c	Sat Apr 30 22:34:44 2011	(r221280)
+++ head/sys/ufs/ffs/ffs_vnops.c	Sat Apr 30 22:46:02 2011	(r221281)
@@ -591,7 +591,7 @@ ffs_read(ap)
 			/*
 			 * If there are no dependencies, and it's VMIO,
 			 * then we don't need the buf, mark it available
-			 * for freeing.  For non-direct VMIO reads, he VM
+			 * for freeing.  For non-direct VMIO reads, the VM
 			 * has the data.
 			 */
 			bp->b_flags |= B_RELBUF;
@@ -986,7 +986,7 @@ ffs_extread(struct vnode *vp, struct uio
 			/*
 			 * If there are no dependencies, and it's VMIO,
 			 * then we don't need the buf, mark it available
-			 * for freeing.  For non-direct VMIO reads, The VM
+			 * for freeing.  For non-direct VMIO reads, the VM
 			 * has the data.
 			 */
 			bp->b_flags |= B_RELBUF;

From owner-svn-src-head@FreeBSD.ORG  Sat Apr 30 23:00:41 2011
Return-Path: 
Delivered-To: svn-src-head@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D2AB41065676;
	Sat, 30 Apr 2011 23:00:41 +0000 (UTC) (envelope-from mm@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BD0F58FC1B;
	Sat, 30 Apr 2011 23:00:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p3UN0f0S066152;
	Sat, 30 Apr 2011 23:00:41 GMT (envelope-from mm@svn.freebsd.org)
Received: (from mm@localhost)
	by svn.freebsd.org (8.14.4/8.14.4/Submit) id p3UN0fIU066151;
	Sat, 30 Apr 2011 23:00:41 GMT (envelope-from mm@svn.freebsd.org)
Message-Id: <201104302300.p3UN0fIU066151@svn.freebsd.org>
From: Martin Matuska 
Date: Sat, 30 Apr 2011 23:00:41 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r221282 - head/contrib/gcc
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
	
List-Unsubscribe: ,
	
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
	
X-List-Received-Date: Sat, 30 Apr 2011 23:00:41 -0000

Author: mm
Date: Sat Apr 30 23:00:41 2011
New Revision: 221282
URL: http://svn.freebsd.org/changeset/base/221282

Log:
  Add ChangeLog.gcc43 for backported changes from gcc 4.3
  
  MFC after:	3 days

Added:
  head/contrib/gcc/ChangeLog.gcc43

Added: head/contrib/gcc/ChangeLog.gcc43
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/contrib/gcc/ChangeLog.gcc43	Sat Apr 30 23:00:41 2011	(r221282)
@@ -0,0 +1,163 @@
+2007-05-01  Dwarakanath Rajagopal  (r124339)
+ 
+	* config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3 
+	and athlon64-sse3 as improved versions of k8, opteron and athlon64 
+	with SSE3 instruction set support.
+	* doc/invoke.texi: Likewise.
+
+2007-04-07  H.J. Lu   (r123639)
+
+	* config/i386/i386.c (ix86_handle_option): Handle SSSE3.
+
+2007-02-08  Harsha Jagasia   (r121726)
+
+	* config/i386/xmmintrin.h: Make inclusion of emmintrin.h
+	conditional to __SSE2__.
+	(Entries below should have been added to first ChangeLog
+	entry for amdfam10 dated 2007-02-05)
+	* config/i386/emmintrin.h: Generate #error if __SSE2__ is not
+	defined.
+	* config/i386/pmmintrin.h: Generate #error if __SSE3__ is not
+	defined.
+	* config/i386/tmmintrin.h: Generate #error if __SSSE3__ is not
+	defined.
+
+2007-02-07  Jakub Jelinek   (r121687)
+
+	* config/i386/i386.c (override_options): Set PTA_SSSE3 for core2.
+
+2007-01-17  Eric Christopher   (r120846)
+
+	* config.gcc: Support core2 processor.
+
+2006-12-02  H.J. Lu   (r119454 - partial)
+
+	PR target/30040
+	* config/i386/driver-i386.c (bit_SSSE3): New.
+
+2006-11-18  Vladimir Makarov   (r118973)
+
+	* doc/invoke.texi (core2): Add item.
+
+	* config/i386/i386.h (TARGET_CORE2, TARGET_CPU_DEFAULT_core2): New
+	macros.
+	(TARGET_CPU_CPP_BUILTINS): Add code for core2.
+	(TARGET_CPU_DEFAULT_generic): Change value.
+	(TARGET_CPU_DEFAULT_NAMES): Add core2.
+	(processor_type): Add new constant PROCESSOR_CORE2.
+
+	* config/i386/i386.md (cpu): Add core2.
+
+	* config/i386/i386.c (core2_cost): New initialized variable.
+	(m_CORE2): New macro.
+	(x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen,
+	x86_deep_branch, x86_partial_reg_stall, x86_use_simode_fiop,
+	x86_use_cltd, x86_promote_QImode, x86_sub_esp_4, x86_sub_esp_8,
+	x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves,
+	x86_partial_reg_dependency, x86_memory_mismatch_stall,
+	x86_accumulate_outgoing_args, x86_prologue_using_move,
+	x86_epilogue_using_move, x86_arch_always_fancy_math_387,
+	x86_sse_partial_reg_dependency, x86_rep_movl_optimal,
+	x86_use_incdec, x86_four_jump_limit, x86_schedule,
+	x86_pad_returns): Add m_CORE2.
+	(override_options): Add entries for Core2.
+	(ix86_issue_rate): Add case for Core2.
+	
+2006-10-27  Vladimir Makarov   (r118090)
+
+	* config/i386/i386.h (TARGET_GEODE):
+	(TARGET_CPU_CPP_BUILTINS): Add code for geode.
+	(TARGET_CPU_DEFAULT_geode): New macro.
+	(TARGET_CPU_DEFAULT_k6, TARGET_CPU_DEFAULT_k6_2,
+	TARGET_CPU_DEFAULT_k6_3, TARGET_CPU_DEFAULT_athlon,
+	TARGET_CPU_DEFAULT_athlon_sse, TARGET_CPU_DEFAULT_k8,
+	TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_prescott,
+	TARGET_CPU_DEFAULT_nocona, TARGET_CPU_DEFAULT_generic): Increase
+	the macro values.
+	(TARGET_CPU_DEFAULT_NAMES): Add geode.
+	(processor_type): Add PROCESSOR_GEODE.
+
+	* config/i386/i386.md: Include geode.md.
+	(cpu): Add geode.
+
+	* config/i386/i386.c (geode_cost): New initialized global
+	variable.
+	(m_GEODE, m_K6_GEODE): New macros.
+	(x86_use_leave, x86_push_memory, x86_deep_branch, x86_use_sahf,
+	x86_use_himode_fiop, x86_promote_QImode, x86_add_esp_4,
+	x86_add_esp_8, x86_rep_movl_optimal, x86_ext_80387_constants,
+	x86_schedule): Use m_K6_GEODE instead of m_K6.
+	(x86_movx, x86_cmove): Set up m_GEODE.
+	(x86_integer_DFmode_moves): Clear m_GEODE.
+	(processor_target_table): Add entry for geode.
+	(processor_alias_table): Ditto.
+
+	* config/i386/geode.md: New file.
+
+	* doc/invoke.texi: Add entry about geode processor.
+    
+2006-10-22  H.J. Lu   (r117958)
+
+	* config.gcc (i[34567]86-*-*): Add tmmintrin.h to extra_headers.
+	(x86_64-*-*): Likewise.
+
+	* config/i386/i386.c (pta_flags): Add PTA_SSSE3.
+	(override_options): Check SSSE3.
+	(ix86_builtins): Add IX86_BUILTIN_PHADDW, IX86_BUILTIN_PHADDD,
+	IX86_BUILTIN_PHADDSW, IX86_BUILTIN_PHSUBW, IX86_BUILTIN_PHSUBD,
+	IX86_BUILTIN_PHSUBSW, IX86_BUILTIN_PMADDUBSW,
+	IX86_BUILTIN_PMULHRSW, IX86_BUILTIN_PSHUFB,
+	IX86_BUILTIN_PSIGNB, IX86_BUILTIN_PSIGNW, IX86_BUILTIN_PSIGND,
+	IX86_BUILTIN_PALIGNR, IX86_BUILTIN_PABSB, IX86_BUILTIN_PABSW,
+	IX86_BUILTIN_PABSD, IX86_BUILTIN_PHADDW128,
+	IX86_BUILTIN_PHADDD128, IX86_BUILTIN_PHADDSW128,
+	IX86_BUILTIN_PHSUBW128, IX86_BUILTIN_PHSUBD128,
+	IX86_BUILTIN_PHSUBSW128, IX86_BUILTIN_PMADDUBSW128,
+	IX86_BUILTIN_PMULHRSW128, IX86_BUILTIN_PSHUFB128,
+	IX86_BUILTIN_PSIGNB128, IX86_BUILTIN_PSIGNW128,
+	IX86_BUILTIN_PSIGND128, IX86_BUILTIN_PALIGNR128,
+	IX86_BUILTIN_PABSB128, IX86_BUILTIN_PABSW128 and
+	IX86_BUILTIN_PABSD128.
+	(bdesc_2arg): Add SSSE3.
+	(bdesc_1arg): Likewise.
+	(ix86_init_mmx_sse_builtins): Support SSSE3.
+	(ix86_expand_builtin): Likewise.
+	* config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): Likewise.
+
+	* config/i386/i386.md (UNSPEC_PSHUFB): New.
+	(UNSPEC_PSIGN): Likewise.
+	(UNSPEC_PALIGNR): Likewise.
+	Include mmx.md before sse.md.
+
+	* config/i386/i386.opt: Add -mssse3.
+
+	* config/i386/sse.md (ssse3_phaddwv8hi3): New pattern for SSSE3.
+	(ssse3_phaddwv4hi3): Likewise.
+	(ssse3_phadddv4si3): Likewise.
+	(ssse3_phadddv2si3): Likewise.
+	(ssse3_phaddswv8hi3): Likewise.
+	(ssse3_phaddswv4hi3): Likewise.
+	(ssse3_phsubwv8hi3): Likewise.
+	(ssse3_phsubwv4hi3): Likewise.
+	(ssse3_phsubdv4si3): Likewise.
+	(ssse3_phsubdv2si3): Likewise.
+	(ssse3_phsubswv8hi3): Likewise.
+	(ssse3_phsubswv4hi3): Likewise.
+	(ssse3_pmaddubswv8hi3): Likewise.
+	(ssse3_pmaddubswv4hi3): Likewise.
+	(ssse3_pmulhrswv8hi3): Likewise.
+	(ssse3_pmulhrswv4hi3): Likewise.
+	(ssse3_pshufbv16qi3): Likewise.
+	(ssse3_pshufbv8qi3): Likewise.
+	(ssse3_psign3): Likewise.
+	(ssse3_psign3): Likewise.
+	(ssse3_palignrti): Likewise.
+	(ssse3_palignrdi): Likewise.
+	(abs2): Likewise.
+	(abs2): Likewise.
+
+	* config/i386/tmmintrin.h: New file.
+
+	* doc/extend.texi: Document SSSE3 built-in functions.
+
+	* doc/invoke.texi: Document -mssse3/-mno-ssse3 switches.