Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jul 2013 08:19:01 +0000 (UTC)
From:      Attilio Rao <attilio@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r253485 - in user/attilio/vmobj-readlock: cddl/contrib/opensolaris/cmd/zpool contrib/binutils/binutils contrib/binutils/include/elf etc lib/libgeom sbin/mount sbin/nvmecontrol sbin/rout...
Message-ID:  <201307200819.r6K8J1q3066842@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: attilio
Date: Sat Jul 20 08:19:00 2013
New Revision: 253485
URL: http://svnweb.freebsd.org/changeset/base/253485

Log:
  MFC

Added:
  user/attilio/vmobj-readlock/sbin/mount/mount.conf.8
     - copied unchanged from r253484, user/attilio/vmcontention/sbin/mount/mount.conf.8
  user/attilio/vmobj-readlock/sys/dev/nvme/nvme_util.c
     - copied unchanged from r253484, user/attilio/vmcontention/sys/dev/nvme/nvme_util.c
  user/attilio/vmobj-readlock/usr.sbin/bhyve/virtio.c
     - copied unchanged from r253484, user/attilio/vmcontention/usr.sbin/bhyve/virtio.c
Modified:
  user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c
  user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h
  user/attilio/vmobj-readlock/etc/network.subr
  user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c
  user/attilio/vmobj-readlock/lib/libgeom/libgeom.h
  user/attilio/vmobj-readlock/sbin/mount/Makefile   (contents, props changed)
  user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile
  user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c
  user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c
  user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c
  user/attilio/vmobj-readlock/sbin/route/route.c
  user/attilio/vmobj-readlock/share/man/man9/bus_dma.9
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  user/attilio/vmobj-readlock/sys/conf/files.amd64
  user/attilio/vmobj-readlock/sys/conf/files.i386
  user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c
  user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h
  user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c
  user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c
  user/attilio/vmobj-readlock/sys/dev/bge/if_bgereg.h
  user/attilio/vmobj-readlock/sys/dev/drm2/i915/i915_gem.c
  user/attilio/vmobj-readlock/sys/dev/ichsmb/ichsmb_pci.c
  user/attilio/vmobj-readlock/sys/dev/ichwd/ichwd.c
  user/attilio/vmobj-readlock/sys/dev/ichwd/ichwd.h
  user/attilio/vmobj-readlock/sys/dev/mii/brgphy.c
  user/attilio/vmobj-readlock/sys/dev/mii/miidevs
  user/attilio/vmobj-readlock/sys/dev/mps/mps.c
  user/attilio/vmobj-readlock/sys/dev/mps/mps_mapping.c
  user/attilio/vmobj-readlock/sys/dev/mps/mps_pci.c
  user/attilio/vmobj-readlock/sys/dev/mps/mps_sas.c
  user/attilio/vmobj-readlock/sys/dev/mps/mps_sas_lsi.c
  user/attilio/vmobj-readlock/sys/dev/mps/mps_table.c
  user/attilio/vmobj-readlock/sys/dev/mps/mps_user.c
  user/attilio/vmobj-readlock/sys/dev/mps/mpsvar.h
  user/attilio/vmobj-readlock/sys/dev/nvd/nvd.c
  user/attilio/vmobj-readlock/sys/dev/nvme/nvme.c
  user/attilio/vmobj-readlock/sys/dev/nvme/nvme.h
  user/attilio/vmobj-readlock/sys/dev/nvme/nvme_ctrlr.c
  user/attilio/vmobj-readlock/sys/dev/nvme/nvme_ns.c
  user/attilio/vmobj-readlock/sys/dev/nvme/nvme_ns_cmd.c
  user/attilio/vmobj-readlock/sys/dev/pci/pci.c
  user/attilio/vmobj-readlock/sys/dev/pci/pci_pci.c
  user/attilio/vmobj-readlock/sys/dev/pci/pci_private.h
  user/attilio/vmobj-readlock/sys/dev/pci/pcib_private.h
  user/attilio/vmobj-readlock/sys/dev/syscons/syscons.c
  user/attilio/vmobj-readlock/sys/dev/usb/usb_pf.c
  user/attilio/vmobj-readlock/sys/fs/fuse/fuse_kernel.h
  user/attilio/vmobj-readlock/sys/kern/sysv_shm.c
  user/attilio/vmobj-readlock/sys/modules/nvme/Makefile
  user/attilio/vmobj-readlock/sys/netinet/sctp_output.c
  user/attilio/vmobj-readlock/sys/ofed/drivers/net/mlx4/main.c
  user/attilio/vmobj-readlock/sys/ofed/include/linux/sysfs.h
  user/attilio/vmobj-readlock/sys/vm/vm_map.c
  user/attilio/vmobj-readlock/sys/vm/vm_map.h
  user/attilio/vmobj-readlock/sys/vm/vm_mmap.c
  user/attilio/vmobj-readlock/tools/regression/aio/aiop/aiop.c
  user/attilio/vmobj-readlock/usr.bin/kdump/kdump.c
  user/attilio/vmobj-readlock/usr.bin/uniq/uniq.c
  user/attilio/vmobj-readlock/usr.sbin/bhyve/Makefile
  user/attilio/vmobj-readlock/usr.sbin/bhyve/bhyverun.c
  user/attilio/vmobj-readlock/usr.sbin/bhyve/pci_virtio_block.c
  user/attilio/vmobj-readlock/usr.sbin/bhyve/pci_virtio_net.c
  user/attilio/vmobj-readlock/usr.sbin/bhyve/virtio.h
  user/attilio/vmobj-readlock/usr.sbin/pciconf/cap.c
Directory Properties:
  user/attilio/vmobj-readlock/   (props changed)
  user/attilio/vmobj-readlock/cddl/   (props changed)
  user/attilio/vmobj-readlock/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmobj-readlock/contrib/binutils/   (props changed)
  user/attilio/vmobj-readlock/contrib/ipfilter/   (props changed)
  user/attilio/vmobj-readlock/sbin/   (props changed)
  user/attilio/vmobj-readlock/sys/   (props changed)
  user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmobj-readlock/sys/conf/   (props changed)
  user/attilio/vmobj-readlock/sys/contrib/ipfilter/   (props changed)
  user/attilio/vmobj-readlock/usr.sbin/bhyve/   (props changed)

Modified: user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -3997,7 +3997,7 @@ print_dedup_stats(nvlist_t *config)
 
 	/*
 	 * If the pool was faulted then we may not have been able to
-	 * obtain the config. Otherwise, if have anything in the dedup
+	 * obtain the config. Otherwise, if we have anything in the dedup
 	 * table continue processing the stats.
 	 */
 	if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,

Modified: user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c
==============================================================================
--- user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/contrib/binutils/binutils/readelf.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -9103,8 +9103,6 @@ get_note_type (unsigned e_type)
 	return _("NT_FPREGS (floating point registers)");
       case NT_PSINFO:
 	return _("NT_PSINFO (psinfo structure)");
-      case NT_THRMISC:
-	return _("NT_THRMISC (thrmisc structure)");
       case NT_LWPSTATUS:
 	return _("NT_LWPSTATUS (lwpstatus_t structure)");
       case NT_LWPSINFO:
@@ -9130,6 +9128,52 @@ get_note_type (unsigned e_type)
 }
 
 static const char *
+get_freebsd_note_type (unsigned e_type)
+{
+  static char buff[64];
+
+  if (elf_header.e_type == ET_CORE)
+    switch (e_type)
+      {
+      case NT_THRMISC:
+	return _("NT_THRMISC (thrmisc structure)");
+      case NT_PROCSTAT_PROC:
+	return _("NT_PROCSTAT_PROC (proc data)");
+      case NT_PROCSTAT_FILES:
+	return _("NT_PROCSTAT_FILES (files data)");
+      case NT_PROCSTAT_VMMAP:
+	return _("NT_PROCSTAT_VMMAP (vmmap data)");
+      case NT_PROCSTAT_GROUPS:
+	return _("NT_PROCSTAT_GROUPS (groups data)");
+      case NT_PROCSTAT_UMASK:
+	return _("NT_PROCSTAT_UMASK (umask data)");
+      case NT_PROCSTAT_RLIMIT:
+	return _("NT_PROCSTAT_RLIMIT (rlimit data)");
+      case NT_PROCSTAT_OSREL:
+	return _("NT_PROCSTAT_OSREL (osreldate data)");
+      case NT_PROCSTAT_PSSTRINGS:
+	return _("NT_PROCSTAT_PSSTRINGS (ps_strings data)");
+      case NT_PROCSTAT_AUXV:
+	return _("NT_PROCSTAT_AUXV (auxv data)");
+      default:
+	return get_note_type(e_type);
+      }
+  else
+    switch (e_type)
+      {
+      case NT_FREEBSD_ABI_TAG:
+	return _("NT_FREEBSD_ABI_TAG");
+      case NT_FREEBSD_NOINIT_TAG:
+	return _("NT_FREEBSD_NOINIT_TAG");
+      default:
+	break;
+      }
+
+  snprintf (buff, sizeof(buff), _("Unknown note type: (0x%08x)"), e_type);
+  return buff;
+}
+
+static const char *
 get_netbsd_elfcore_note_type (unsigned e_type)
 {
   static char buff[64];
@@ -9206,6 +9250,10 @@ process_note (Elf_Internal_Note *pnote)
        note type strings.  */
     nt = get_note_type (pnote->type);
 
+  else if (const_strneq (pnote->namedata, "FreeBSD"))
+    /* FreeBSD-specific core file notes.  */
+    nt = get_freebsd_note_type (pnote->type);
+
   else if (const_strneq (pnote->namedata, "NetBSD-CORE"))
     /* NetBSD-specific core file notes.  */
     nt = get_netbsd_elfcore_note_type (pnote->type);
@@ -9215,7 +9263,7 @@ process_note (Elf_Internal_Note *pnote)
        note type strings.  */
       nt = get_note_type (pnote->type);
 
-  printf ("  %s\t\t0x%08lx\t%s\n",
+  printf ("  %-13s 0x%08lx\t%s\n",
 	  pnote->namesz ? pnote->namedata : "(NONE)",
 	  pnote->descsz, nt);
   return 1;

Modified: user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h
==============================================================================
--- user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/contrib/binutils/include/elf/common.h	Sat Jul 20 08:19:00 2013	(r253485)
@@ -388,7 +388,6 @@
 #define NT_PRPSINFO	3		/* Contains copy of prpsinfo struct */
 #define NT_TASKSTRUCT	4		/* Contains copy of task struct */
 #define NT_AUXV		6		/* Contains copy of Elfxx_auxv_t */
-#define NT_THRMISC	7		/* Contains copy of thrmisc struct */
 #define NT_PRXFPREG	0x46e62b7f	/* Contains a user_xfpregs_struct; */
 					/*   note name must be "LINUX".  */
 
@@ -401,6 +400,19 @@
 #define NT_LWPSINFO	17		/* Has a struct lwpsinfo_t */
 #define NT_WIN32PSTATUS	18		/* Has a struct win32_pstatus */
 
+/* Note segments for core files on FreeBSD systems.  Note name
+   must start with "FreeBSD".  */
+#define NT_THRMISC		7	/* Contains copy of thrmisc struct */
+#define NT_PROCSTAT_PROC	8
+#define NT_PROCSTAT_FILES	9
+#define NT_PROCSTAT_VMMAP	10
+#define NT_PROCSTAT_GROUPS	11
+#define NT_PROCSTAT_UMASK	12
+#define NT_PROCSTAT_RLIMIT	13
+#define NT_PROCSTAT_OSREL	14
+#define NT_PROCSTAT_PSSTRINGS	15
+#define NT_PROCSTAT_AUXV	16
+
 
 /* Note segments for core files on NetBSD systems.  Note name
    must start with "NetBSD-CORE".  */

Modified: user/attilio/vmobj-readlock/etc/network.subr
==============================================================================
--- user/attilio/vmobj-readlock/etc/network.subr	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/etc/network.subr	Sat Jul 20 08:19:00 2013	(r253485)
@@ -1052,16 +1052,12 @@ ifalias_af_common()
 #
 ipv6_prefix_hostid_addr_common()
 {
-	local _if _action prefix laddr hostid j address
+	local _if _action prefix j
 	_if=$1
 	_action=$2
 	prefix=`get_if_var ${_if} ipv6_prefix_IF`
 
 	if [ -n "${prefix}" ]; then
-		laddr=`network6_getladdr ${_if}`
-		hostid=${laddr#fe80::}
-		hostid=${hostid%\%*}
-
 		for j in ${prefix}; do
 			# The default prefixlen is 64.
 			plen=${j#*/}
@@ -1071,18 +1067,10 @@ ipv6_prefix_hostid_addr_common()
 			esac
 
 			# Normalize the last part by removing ":"
-			j=${j%:*}
+			j=${j%::*}
 			j=${j%:}
-			OIFS=$IFS; IFS=":"; set -- $j; nj=$#; IFS=$OIFS
-			OIFS=$IFS; IFS=":"; set -- $hostid; nh=$#; IFS=$OIFS
-			if [ $(($nj + $nh)) -eq 8 ]; then
-				address=$j\:$hostid
-			else
-				address=$j\::$hostid
-			fi
-
-			${IFCONFIG_CMD} ${_if} inet6 ${address} \
-				prefixlen $plen ${_action}
+			${IFCONFIG_CMD} ${_if} inet6 $j:: \
+				prefixlen $plen eui64 ${_action}
 
 			# if I am a router, add subnet router
 			# anycast address (RFC 2373).

Modified: user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c
==============================================================================
--- user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/lib/libgeom/geom_xml2tree.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -282,7 +282,9 @@ EndElement(void *userData, const char *n
 	}
 
 	if (p != NULL) {
+#if DEBUG_LIBGEOM > 0
 		printf("Unexpected XML: name=%s data=\"%s\"\n", name, p);
+#endif
 		free(p);
 	}
 

Modified: user/attilio/vmobj-readlock/lib/libgeom/libgeom.h
==============================================================================
--- user/attilio/vmobj-readlock/lib/libgeom/libgeom.h	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/lib/libgeom/libgeom.h	Sat Jul 20 08:19:00 2013	(r253485)
@@ -40,6 +40,10 @@
 
 __BEGIN_DECLS
 
+#ifndef DEBUG_LIBGEOM
+#define DEBUG_LIBGEOM 0
+#endif
+
 void geom_stats_close(void);
 void geom_stats_resync(void);
 int geom_stats_open(void);

Modified: user/attilio/vmobj-readlock/sbin/mount/Makefile
==============================================================================
--- user/attilio/vmobj-readlock/sbin/mount/Makefile	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sbin/mount/Makefile	Sat Jul 20 08:19:00 2013	(r253485)
@@ -3,7 +3,7 @@
 
 PROG=	mount
 SRCS=	mount.c mount_fs.c getmntopts.c vfslist.c
-MAN=	mount.8
+MAN=	mount.8 mount.conf.8
 # We do NOT install the getmntopts.3 man page.
 
 DPADD=	${LIBUTIL}

Copied: user/attilio/vmobj-readlock/sbin/mount/mount.conf.8 (from r253484, user/attilio/vmcontention/sbin/mount/mount.conf.8)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmobj-readlock/sbin/mount/mount.conf.8	Sat Jul 20 08:19:00 2013	(r253485, copy of r253484, user/attilio/vmcontention/sbin/mount/mount.conf.8)
@@ -0,0 +1,252 @@
+.\" Copyright (c) 2013 Marcel Moolenaar
+.\" Copyright (c) 2013 Craig Rodrigues
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.\"
+.Dd July 7, 2013
+.Dt MOUNT.CONF 8
+.Os
+.Sh NAME
+.Nm mount.conf
+.Nd root file system mount configuration file
+.Sh SYNOPSIS
+.Pa /.mount.conf
+.Sh DESCRIPTION
+During the bootup process, the
+.Fx
+kernel will try to mount the root file system
+using the logic in the
+.Fn vfs_mountroot
+function in
+.Pa src/sys/kern/vfs_mountroot.c .
+The root mount logic can be described as follows:
+.Bl -enum
+.It
+The kernel will synthesize in memory a config file
+with default directives for mounting
+the root file system.
+The logic for this is in
+.Fn vfs_mountroot_conf0 .
+.It
+The kernel will first mount
+.Xr devfs 8
+as the root file system.
+.It
+Next, the kernel will parse the in-memory config file created in step 1
+and try to mount the actual root file system.
+See
+.Sx FILE FORMAT
+for the format of the config file.
+.It
+When the actual root file system is mounted,
+.Xr devfs
+will be re-mounted on the
+.Pa /dev
+directory.
+.It
+If a
+.Pa /.mount.conf
+file does not exist in the root file system which was
+just mounted, the root mount logic stops here.
+.It
+If a
+.Pa /.mount.conf
+file exists in the root file system which was just mounted,
+this file will be parsed, and the kernel will use this new config
+file to try to re-mount the root file system.
+See
+.Sx FILE FORMAT
+for the format of the config file.
+.It
+If the new root file system has a
+.Pa /.mount
+directory, the old root file system will be re-mounted
+on
+.Pa /.mount .
+.It
+The root mount logic will go back to step 4.
+.El
+.Pp
+The root mount logic is recursive, and step 8 will
+be repeated as long as each new root file system
+which is mounted has a
+.Pa /.mount.conf
+file.
+.Sh FILE FORMAT
+The kernel parses each line in
+.Pa .mount.conf
+and then tries to perform the action specified on that line as soon as it is parsed.
+.Bl -tag -width "XXXXXXXXXX"
+.It Ic #
+A line beginning with a # is a comment and is ignored.
+.It Ic {FS}:{MOUNTPOINT} {OPTIONS}
+The kernel will try to mount this in an
+operation equivalent to:
+.Bd -literal -offset indent
+mount -t {FS} -o {OPTIONS} {MOUNTPOINT} /
+.Ed
+.Pp
+If this is successfully mounted,
+further lines in
+.Pa .mount.conf
+are ignored.
+If all lines in
+.Pa .mount.conf
+have been processed and no root file system has been successfully
+mounted, then the action specified by
+.Ic .onfail
+is performed.
+.It Ic .ask
+When the kernel processes this line, a
+.Li mountroot>
+command-line prompt is displayed.
+At this prompt, the operator can enter the
+the root mount.
+.It Ic .md Ar file
+Create a memory backed
+.Xr md 4
+virtual disk, using
+.Ar file
+as the backing store.
+.It Ic .onfail Ar [panic|reboot|retry|continue]
+If after parsing all the lines in
+.Pa .mount.conf
+the kernel is unable to mount a root file system,
+the
+.Ic .onfail
+directive tells the kernel what action to perform.
+.It Ic .timeout Ar N
+Before trying to mount a root file system,
+if the root mount device does not exist, wait at most
+.Ar N
+seconds for the device to appear before trying to mount it.
+If
+.Ic .timeout
+is not specified, the default timeout is 3 seconds.
+.El
+.Sh EXAMPLES
+The following example
+.Pa .mount.conf
+will direct the kernel to try mounting the root file system
+first as an ISO CD9660 file system on
+.Pa /dev/cd0 ,
+then if that does not work, as an ISO CD9660 file system on
+.Pa /dev/acd0 ,
+and then if that does not work, as a UFS file system on
+.Pa /dev/ada0s1a .
+If that does not work, a
+.Li mountroot>
+command-line prompt will be displayed where the operator
+can manually enter the root file system to mount.
+Finally if that does not work, the kernel will panic.
+.Bd -literal -offset indent
+.Li .onfail panic
+.Li .timeout 3
+cd9660:/dev/cd0 ro
+.Li .timeout 0
+cd9660:/dev/acd0 ro
+.Li .timeout 3
+ufs:/dev/ada0s1a
+.Li .ask
+.Ed
+.Pp
+The following example
+.Pa .mount.conf
+will direct the kernel to create a
+.Xr md 4
+memory disk attached to the file
+.Pa /data/OS-1.0.iso
+and then mount the ISO CD9660 file system
+on the md device which was just created.
+The last line is a comment which is ignored.
+.Bd -literal -offset indent
+.Li .timeout 3
+.Li .md /data/OS-1.0.iso
+.Li cd9600:/dev/md# ro
+.Li # Can also use cd9660:/dev/md0 ro
+.Ed
+.Pp
+The following example
+.Pa .mount.conf
+will direct the kernel to create a
+.Xr md 4
+memory disk attached to the file
+.Pa /data/base.ufs.uzip
+and then mount the UFS file system
+on the md uzip device which was just created
+by the
+.Xr geom_uzip 4
+driver.
+.Bd -literal -offset indent
+.Li .md /data/base.ufs.uzip
+.Li ufs:/dev/md#.uzip ro
+.Li # Can also use ufs:/dev/md0.uzip ro
+.Ed
+.Pp
+The following example
+.Pa .mount.conf
+will direct the kernel to do a unionfs
+mount on a directory
+.Pa /jail/freebsd-8-stable
+which has a
+.Xr chroot 2
+environment.
+.Bd -literal -offset indent
+.Li .timeout 3
+.Li unionfs:/jail/freebsd-8-stable
+.Ed
+.Sh NOTES
+For each root file system which is mounted, a
+.Pa /dev
+directory
+.Em must
+exist so that the root mount logic can properly re-mount
+.Xr devfs 8 .
+If this directory does not exist, the system
+may hang during the bootup process.
+.Sh SEE ALSO
+.Xr nmount 2 ,
+.Xr md 4 ,
+.Xr boot.config 5 ,
+.Xr fstab 5 ,
+.Xr boot 8 ,
+.Xr loader 8 ,
+.Xr mount 8
+.Sh HISTORY
+The
+.Nm
+file first appeared in
+.Fx 9.0 .
+.Sh AUTHORS
+.An -nosplit
+The root mount logic in the
+.Fx
+kernel which parses
+.Pa /.mount.conf
+was written by
+.An Marcel Moolenaar Aq marcel@FreeBSD.org .
+This man page was written by
+.An Craig Rodrigues Aq rodrigc@FreeBSD.org .

Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile
==============================================================================
--- user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sbin/nvmecontrol/Makefile	Sat Jul 20 08:19:00 2013	(r253485)
@@ -2,7 +2,9 @@
 
 PROG=	nvmecontrol
 SRCS=	nvmecontrol.c devlist.c firmware.c identify.c logpage.c	\
-	perftest.c reset.c
+	perftest.c reset.c nvme_util.c
 MAN=	nvmecontrol.8
 
+.PATH:	${.CURDIR}/../../sys/dev/nvme
+
 .include <bsd.prog.mk>

Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c
==============================================================================
--- user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sbin/nvmecontrol/devlist.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -30,7 +30,9 @@ __FBSDID("$FreeBSD$");
 #include <sys/param.h>
 
 #include <err.h>
+#include <errno.h>
 #include <fcntl.h>
+#include <paths.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -51,7 +53,7 @@ static inline uint32_t
 ns_get_sector_size(struct nvme_namespace_data *nsdata)
 {
 
-	return (1 << nsdata->lbaf[0].lbads);
+	return (1 << nsdata->lbaf[nsdata->flbas.format].lbads);
 }
 
 void
@@ -60,6 +62,7 @@ devlist(int argc, char *argv[])
 	struct nvme_controller_data	cdata;
 	struct nvme_namespace_data	nsdata;
 	char				name[64];
+	uint8_t				mn[64];
 	uint32_t			i;
 	int				ch, ctrlr, fd, found, ret;
 
@@ -80,8 +83,8 @@ devlist(int argc, char *argv[])
 		ret = open_dev(name, &fd, 0, 0);
 
 		if (ret != 0) {
-			if (fd < 0) {
-				warnx("could not open /dev/%s\n", name);
+			if (ret == EACCES) {
+				warnx("could not open "_PATH_DEV"%s\n", name);
 				continue;
 			} else
 				break;
@@ -89,7 +92,8 @@ devlist(int argc, char *argv[])
 
 		found++;
 		read_controller_data(fd, &cdata);
-		printf("%6s: %s\n", name, cdata.mn);
+		nvme_strvis(mn, cdata.mn, sizeof(mn), NVME_MODEL_NUMBER_LENGTH);
+		printf("%6s: %s\n", name, mn);
 
 		for (i = 0; i < cdata.nn; i++) {
 			sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr,

Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c
==============================================================================
--- user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sbin/nvmecontrol/identify.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -43,13 +43,18 @@ __FBSDID("$FreeBSD$");
 static void
 print_controller(struct nvme_controller_data *cdata)
 {
+	uint8_t str[128];
+
 	printf("Controller Capabilities/Features\n");
 	printf("================================\n");
 	printf("Vendor ID:                  %04x\n", cdata->vid);
 	printf("Subsystem Vendor ID:        %04x\n", cdata->ssvid);
-	printf("Serial Number:              %s\n", cdata->sn);
-	printf("Model Number:               %s\n", cdata->mn);
-	printf("Firmware Version:           %s\n", cdata->fr);
+	nvme_strvis(str, cdata->sn, sizeof(str), NVME_SERIAL_NUMBER_LENGTH);
+	printf("Serial Number:              %s\n", str);
+	nvme_strvis(str, cdata->mn, sizeof(str), NVME_MODEL_NUMBER_LENGTH);
+	printf("Model Number:               %s\n", str);
+	nvme_strvis(str, cdata->fr, sizeof(str), NVME_FIRMWARE_REVISION_LENGTH);
+	printf("Firmware Version:           %s\n", str);
 	printf("Recommended Arb Burst:      %d\n", cdata->rab);
 	printf("IEEE OUI Identifier:        %02x %02x %02x\n",
 		cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]);

Modified: user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c
==============================================================================
--- user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sbin/nvmecontrol/nvmecontrol.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
 #include <err.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <paths.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include <stdio.h>
@@ -163,7 +164,6 @@ read_namespace_data(int fd, int nsid, st
 int
 open_dev(const char *str, int *fd, int show_error, int exit_on_error)
 {
-	struct stat	devstat;
 	char		full_path[64];
 
 	if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) {
@@ -173,19 +173,10 @@ open_dev(const char *str, int *fd, int s
 		if (exit_on_error)
 			exit(1);
 		else
-			return (1);
-	}
-
-	snprintf(full_path, sizeof(full_path), "/dev/%s", str);
-	if (stat(full_path, &devstat) != 0) {
-		if (show_error)
-			warn("could not stat %s", full_path);
-		if (exit_on_error)
-			exit(1);
-		else
-			return (1);
+			return (EINVAL);
 	}
 
+	snprintf(full_path, sizeof(full_path), _PATH_DEV"%s", str);
 	*fd = open(full_path, O_RDWR);
 	if (*fd < 0) {
 		if (show_error)
@@ -193,7 +184,7 @@ open_dev(const char *str, int *fd, int s
 		if (exit_on_error)
 			exit(1);
 		else
-			return (1);
+			return (errno);
 	}
 
 	return (0);

Modified: user/attilio/vmobj-readlock/sbin/route/route.c
==============================================================================
--- user/attilio/vmobj-readlock/sbin/route/route.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sbin/route/route.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -1457,7 +1457,10 @@ rtmsg(int cmd, int flags, int fib)
 
 #define NEXTADDR(w, u)							\
 	if (rtm_addrs & (w)) {						\
-		l = SA_SIZE((struct sockaddr *)&(u));			\
+		l = (((struct sockaddr *)&(u))->sa_len == 0) ?		\
+		    sizeof(long) :					\
+		    1 + ((((struct sockaddr *)&(u))->sa_len - 1)	\
+			| (sizeof(long) - 1));				\
 		memmove(cp, (char *)&(u), l);				\
 		cp += l;						\
 		if (verbose)						\

Modified: user/attilio/vmobj-readlock/share/man/man9/bus_dma.9
==============================================================================
--- user/attilio/vmobj-readlock/share/man/man9/bus_dma.9	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/share/man/man9/bus_dma.9	Sat Jul 20 08:19:00 2013	(r253485)
@@ -60,7 +60,7 @@
 .\" $FreeBSD$
 .\" $NetBSD: bus_dma.9,v 1.25 2002/10/14 13:43:16 wiz Exp $
 .\"
-.Dd May 12, 2009
+.Dd July 17, 2013
 .Dt BUS_DMA 9
 .Os
 .Sh NAME
@@ -70,6 +70,8 @@
 .Nm bus_dmamap_create ,
 .Nm bus_dmamap_destroy ,
 .Nm bus_dmamap_load ,
+.Nm bus_dmamap_load_bio ,
+.Nm bus_dmamap_load_ccb ,
 .Nm bus_dmamap_load_mbuf ,
 .Nm bus_dmamap_load_mbuf_sg ,
 .Nm bus_dmamap_load_uio ,
@@ -97,6 +99,14 @@
 "bus_size_t buflen" "bus_dmamap_callback_t *callback" "void *callback_arg" \
 "int flags"
 .Ft int
+.Fn bus_dmamap_load_bio "bus_dma_tag_t dmat" "bus_dmamap_t map" \
+"struct bio *bio" "bus_dmamap_callback_t *callback" "void *callback_arg" \
+"int flags"
+.Ft int
+.Fn bus_dmamap_load_ccb "bus_dma_tag_t dmat" "bus_dmamap_t map" \
+"union ccb *ccb" "bus_dmamap_callback_t *callback" "void *callback_arg" \
+"int flags"
+.Ft int
 .Fn bus_dmamap_load_mbuf "bus_dma_tag_t dmat" "bus_dmamap_t map" \
 "struct mbuf *mbuf" "bus_dmamap_callback2_t *callback" "void *callback_arg" \
 "int flags"
@@ -199,7 +209,10 @@ Client specified callback for receiving 
 the load of a
 .Vt bus_dmamap_t
 via
-.Fn bus_dmamap_load .
+.Fn bus_dmamap_load ,
+.Fn bus_dmamap_load_bio
+or
+.Fn bus_dmamap_load_ccb .
 Callbacks are of the format:
 .Bl -tag -width indent
 .It Ft void
@@ -624,6 +637,49 @@ This array is only valid during the scop
 A mapping could not be achieved within the segment constraints provided
 in the tag even though the requested allocation size was less than maxsize.
 .El
+.It Fn bus_dmamap_load_bio "dmat" "map" "bio" "callback" "callback_arg" "flags"
+This is a variation of
+.Fn bus_dmamap_load
+which maps buffers pointed to by
+.Fa bio
+for DMA transfers.
+.Fa bio
+may point to either a mapped or unmapped buffer.
+.It Fn bus_dmamap_load_ccb "dmat" "map" "ccb" "callback" "callback_arg" "flags"
+This is a variation of
+.Fn bus_dmamap_load
+which maps data pointed to by
+.Fa ccb
+for DMA transfers.
+The data for
+.Fa ccb
+may be any of the following types:
+.Bl -tag -width ".Er CAM_DATA_SG_PADDR"
+.It CAM_DATA_VADDR
+The data is a single KVA buffer.
+.It CAM_DATA_PADDR
+The data is a single bus address range.
+.It CAM_DATA_SG
+The data is a scatter/gather list of KVA buffers.
+.It CAM_DATA_SG_PADDR
+The data is a scatter/gather list of bus address ranges.
+.It CAM_DATA_BIO
+The data is contained in a
+.Vt struct bio
+attached to the CCB.
+.El
+.Pp
+.Fn bus_dmamap_load_ccb
+supports the following CCB XPT function codes:
+.Pp
+.Bl -item -offset indent -compact
+.It
+XPT_ATA_IO
+.It
+XPT_CONT_TARGET_IO
+.It
+XPT_SCSI_IO
+.El
 .It Fn bus_dmamap_load_mbuf "dmat" "map" "mbuf" "callback2" "callback_arg" \
 "flags"
 This is a variation of
@@ -898,12 +954,16 @@ These functions include:
 .It
 .Fn bus_dmamap_load
 .It
-.Fn bus_dmamap_load_uio
+.Fn bus_dmamap_load_bio
+.It
+.Fn bus_dmamap_load_ccb
 .It
 .Fn bus_dmamap_load_mbuf
 .It
 .Fn bus_dmamap_load_mbuf_sg
 .It
+.Fn bus_dmamap_load_uio
+.It
 .Fn bus_dmamap_unload
 .It
 .Fn bus_dmamap_sync

Modified: user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd)
 		vd->vdev_ashift = MAX(ashift, vd->vdev_ashift);
 	} else {
 		/*
-		 * Make sure the alignment requirement hasn't increased.
+		 * Detect if the alignment requirement has increased.
+		 * We don't want to make the pool unavailable, just
+		 * issue a warning instead.
 		 */
-		if (ashift > vd->vdev_top->vdev_ashift) {
-			vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN,
-			    VDEV_AUX_BAD_LABEL);
-			return (EINVAL);
+		if (ashift > vd->vdev_top->vdev_ashift &&
+		    vd->vdev_ops->vdev_op_leaf) {
+			cmn_err(CE_WARN,
+			    "Disk, '%s', has a block alignment that is "
+			    "larger than the pool's alignment\n",
+			    vd->vdev_path);
 		}
 		vd->vdev_max_asize = max_asize;
 	}

Modified: user/attilio/vmobj-readlock/sys/conf/files.amd64
==============================================================================
--- user/attilio/vmobj-readlock/sys/conf/files.amd64	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/conf/files.amd64	Sat Jul 20 08:19:00 2013	(r253485)
@@ -234,6 +234,7 @@ dev/nvme/nvme_ns_cmd.c		optional	nvme
 dev/nvme/nvme_qpair.c		optional	nvme
 dev/nvme/nvme_sysctl.c		optional	nvme
 dev/nvme/nvme_test.c		optional	nvme
+dev/nvme/nvme_util.c		optional	nvme
 dev/nvram/nvram.c		optional	nvram isa
 dev/random/ivy.c		optional	random rdrand_rng
 dev/random/nehemiah.c		optional	random padlock_rng

Modified: user/attilio/vmobj-readlock/sys/conf/files.i386
==============================================================================
--- user/attilio/vmobj-readlock/sys/conf/files.i386	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/conf/files.i386	Sat Jul 20 08:19:00 2013	(r253485)
@@ -243,6 +243,7 @@ dev/nvme/nvme_ns_cmd.c		optional nvme
 dev/nvme/nvme_qpair.c		optional nvme
 dev/nvme/nvme_sysctl.c		optional nvme
 dev/nvme/nvme_test.c		optional nvme
+dev/nvme/nvme_util.c		optional nvme
 dev/nvram/nvram.c		optional nvram isa
 dev/pcf/pcf_isa.c		optional pcf
 dev/random/ivy.c		optional random rdrand_rng

Modified: user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/dev/ahci/ahci.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -196,6 +196,7 @@ static struct {
 	{0x1e078086, 0x00, "Intel Panther Point",	0},
 	{0x1e0e8086, 0x00, "Intel Panther Point",	0},
 	{0x1e0f8086, 0x00, "Intel Panther Point",	0},
+	{0x23a38086, 0x00, "Intel Coleto Creek",        0},
 	{0x8c028086, 0x00, "Intel Lynx Point",	0},
 	{0x8c038086, 0x00, "Intel Lynx Point",	0},
 	{0x8c048086, 0x00, "Intel Lynx Point",	0},

Modified: user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h
==============================================================================
--- user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/dev/ata/ata-pci.h	Sat Jul 20 08:19:00 2013	(r253485)
@@ -274,6 +274,10 @@ struct ata_pci_controller {
 #define ATA_ISCH                0x811a8086
 #define ATA_DH89XXCC            0x23238086
 
+#define ATA_COLETOCRK_AH1       0x23a38086
+#define ATA_COLETOCRK_S1        0x23a18086
+#define ATA_COLETOCRK_S2        0x23a68086
+
 #define ATA_ITE_ID              0x1283
 #define ATA_IT8211F             0x82111283
 #define ATA_IT8212F             0x82121283

Modified: user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/dev/ata/chipsets/ata-intel.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -226,6 +226,9 @@ ata_intel_probe(device_t dev)
      { ATA_I31244,       0,          0, 2, ATA_SA150, "31244" },
      { ATA_ISCH,         0,          0, 1, ATA_UDMA5, "SCH" },
      { ATA_DH89XXCC,     0, INTEL_AHCI, 0, ATA_SA300, "DH89xxCC" },
+     { ATA_COLETOCRK_S1, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" },
+     { ATA_COLETOCRK_S2, 0, INTEL_6CH2, 0, ATA_SA300, "COLETOCRK" },
+     { ATA_COLETOCRK_AH1,0, INTEL_AHCI, 0, ATA_SA300, "COLETOCRK" },
      { 0, 0, 0, 0, 0, 0}};
 
     if (pci_get_vendor(dev) != ATA_INTEL_ID)

Modified: user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c
==============================================================================
--- user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c	Sat Jul 20 08:14:09 2013	(r253484)
+++ user/attilio/vmobj-readlock/sys/dev/bge/if_bge.c	Sat Jul 20 08:19:00 2013	(r253485)
@@ -176,6 +176,8 @@ static const struct bge_type {
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5721 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5722 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5723 },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5725 },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5727 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5750 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5750M },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5751 },
@@ -195,6 +197,7 @@ static const struct bge_type {
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5761E },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5761S },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5761SE },
+	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5762 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5764 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5780 },
 	{ BCOM_VENDORID,	BCOM_DEVICEID_BCM5780S },
@@ -310,6 +313,7 @@ static const struct bge_revision {
 	{ BGE_CHIPID_BCM5722_A0,	"BCM5722 A0" },
 	{ BGE_CHIPID_BCM5761_A0,	"BCM5761 A0" },
 	{ BGE_CHIPID_BCM5761_A1,	"BCM5761 A1" },
+	{ BGE_CHIPID_BCM5762_A0,	"BCM5762 A0" },
 	{ BGE_CHIPID_BCM5784_A0,	"BCM5784 A0" },
 	{ BGE_CHIPID_BCM5784_A1,	"BCM5784 A1" },
 	/* 5754 and 5787 share the same ASIC ID */
@@ -354,6 +358,7 @@ static const struct bge_revision bge_maj
 	{ BGE_ASICREV_BCM5717,		"unknown BCM5717" },
 	{ BGE_ASICREV_BCM5719,		"unknown BCM5719" },
 	{ BGE_ASICREV_BCM5720,		"unknown BCM5720" },
+	{ BGE_ASICREV_BCM5762,		"unknown BCM5762" },
 
 	{ 0, NULL }
 };
@@ -1796,6 +1801,20 @@ bge_chipinit(struct bge_softc *sc)
 		pci_write_config(sc->bge_dev, BGE_PCI_MSI_DATA + 2, val, 2);
 	}
 
+	if (sc->bge_asicrev == BGE_ASICREV_BCM57765 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM57766) {
+		/*
+		 * For the 57766 and non Ax versions of 57765, bootcode
+		 * needs to setup the PCIE Fast Training Sequence (FTS)
+		 * value to prevent transmit hangs.
+		 */
+		if (sc->bge_chiprev != BGE_CHIPREV_57765_AX) {
+			CSR_WRITE_4(sc, BGE_CPMU_PADRNG_CTL,
+			    CSR_READ_4(sc, BGE_CPMU_PADRNG_CTL) |
+			    BGE_CPMU_PADRNG_CTL_RDIV2);
+		}
+	}
+
 	/*
 	 * Set up the PCI DMA control register.
 	 */
@@ -1871,8 +1890,9 @@ bge_chipinit(struct bge_softc *sc)
 		 * a status tag update and leave interrupts permanently
 		 * disabled.
 		 */
-		if (sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
-		    sc->bge_asicrev != BGE_ASICREV_BCM57765)
+		if (!BGE_IS_57765_PLUS(sc) &&
+		    sc->bge_asicrev != BGE_ASICREV_BCM5717 &&
+		    sc->bge_asicrev != BGE_ASICREV_BCM5762)
 			dma_rw_ctl |= BGE_PCIDMARWCTL_TAGGED_STATUS_WA;
 	}
 	pci_write_config(sc->bge_dev, BGE_PCI_DMA_RW_CTL, dma_rw_ctl, 4);
@@ -1881,7 +1901,8 @@ bge_chipinit(struct bge_softc *sc)
 	 * Set up general mode register.
 	 */
 	mode_ctl = bge_dma_swap_options(sc);
-	if (sc->bge_asicrev == BGE_ASICREV_BCM5720) {
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5720 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5762) {
 		/* Retain Host-2-BMC settings written by APE firmware. */
 		mode_ctl |= CSR_READ_4(sc, BGE_MODE_CTL) &
 		    (BGE_MODECTL_BYTESWAP_B2HRX_DATA |
@@ -1939,7 +1960,7 @@ bge_blockinit(struct bge_softc *sc)
 	struct bge_rcb *rcb;
 	bus_size_t vrcb;
 	bge_hostaddr taddr;
-	uint32_t dmactl, val;
+	uint32_t dmactl, rdmareg, val;
 	int i, limit;
 
 	/*
@@ -2210,6 +2231,11 @@ bge_blockinit(struct bge_softc *sc)
 	if (!BGE_IS_5705_PLUS(sc))
 		/* 5700 to 5704 had 16 send rings. */
 		limit = BGE_TX_RINGS_EXTSSRAM_MAX;
+	else if (BGE_IS_57765_PLUS(sc) ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5762)
+		limit = 2;
+	else if (BGE_IS_5717_PLUS(sc))
+		limit = 4;
 	else
 		limit = 1;
 	vrcb = BGE_MEMWIN_START + BGE_SEND_RING_RCB;
@@ -2248,6 +2274,7 @@ bge_blockinit(struct bge_softc *sc)
 	} else if (!BGE_IS_5705_PLUS(sc))
 		limit = BGE_RX_RINGS_MAX;
 	else if (sc->bge_asicrev == BGE_ASICREV_BCM5755 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5762 ||
 	    BGE_IS_57765_PLUS(sc))
 		limit = 4;
 	else
@@ -2287,7 +2314,8 @@ bge_blockinit(struct bge_softc *sc)
 
 	/* Set inter-packet gap */
 	val = 0x2620;
-	if (sc->bge_asicrev == BGE_ASICREV_BCM5720)
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5720 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5762)
 		val |= CSR_READ_4(sc, BGE_TX_LENGTHS) &
 		    (BGE_TXLEN_JMB_FRM_LEN_MSK | BGE_TXLEN_CNT_DN_VAL_MSK);
 	CSR_WRITE_4(sc, BGE_TX_LENGTHS, val);
@@ -2451,7 +2479,8 @@ bge_blockinit(struct bge_softc *sc)
 			val |= BGE_RDMAMODE_TSO6_ENABLE;
 	}
 
-	if (sc->bge_asicrev == BGE_ASICREV_BCM5720) {
+	if (sc->bge_asicrev == BGE_ASICREV_BCM5720 ||
+	    sc->bge_asicrev == BGE_ASICREV_BCM5762) {
 		val |= CSR_READ_4(sc, BGE_RDMA_MODE) &
 			BGE_RDMAMODE_H2BNC_VLAN_DET;
 		/*
@@ -2465,14 +2494,18 @@ bge_blockinit(struct bge_softc *sc)
 	    sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
 	    sc->bge_asicrev == BGE_ASICREV_BCM57780 ||
-	    BGE_IS_5717_PLUS(sc)) {
-		dmactl = CSR_READ_4(sc, BGE_RDMA_RSRVCTRL);
+	    BGE_IS_5717_PLUS(sc) || BGE_IS_57765_PLUS(sc)) {
+		if (sc->bge_asicrev == BGE_ASICREV_BCM5762)
+			rdmareg = BGE_RDMA_RSRVCTRL_REG2;
+		else
+			rdmareg = BGE_RDMA_RSRVCTRL;
+		dmactl = CSR_READ_4(sc, rdmareg);
 		/*
 		 * Adjust tx margin to prevent TX data corruption and
 		 * fix internal FIFO overflow.
 		 */
-		if (sc->bge_asicrev == BGE_ASICREV_BCM5719 &&
-		    sc->bge_chipid == BGE_CHIPID_BCM5719_A0) {
+		if (sc->bge_chipid == BGE_CHIPID_BCM5719_A0 ||
+		    sc->bge_asicrev == BGE_ASICREV_BCM5762) {
 			dmactl &= ~(BGE_RDMA_RSRVCTRL_FIFO_LWM_MASK |
 			    BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK |
 			    BGE_RDMA_RSRVCTRL_TXMRGN_MASK);
@@ -2485,7 +2518,7 @@ bge_blockinit(struct bge_softc *sc)
 		 * The fix is to limit the number of RX BDs
 		 * the hardware would fetch at a fime.
 		 */
-		CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL, dmactl |
+		CSR_WRITE_4(sc, rdmareg, dmactl |
 		    BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
 	}
 
@@ -2503,6 +2536,11 @@ bge_blockinit(struct bge_softc *sc)
 		    CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) |
 		    BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 |
 		    BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K);
+	} else if (sc->bge_asicrev == BGE_ASICREV_BCM5762) {
+		CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2,
+		    CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL_REG2) |
+		    BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K |
+		    BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K);
 	}
 
 	CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
@@ -2652,6 +2690,9 @@ bge_chipid(device_t dev)
 		case BCOM_DEVICEID_BCM5718:
 		case BCOM_DEVICEID_BCM5719:
 		case BCOM_DEVICEID_BCM5720:
+		case BCOM_DEVICEID_BCM5725:
+		case BCOM_DEVICEID_BCM5727:
+		case BCOM_DEVICEID_BCM5762:
 			id = pci_read_config(dev,
 			    BGE_PCI_GEN2_PRODID_ASICREV, 4);
 			break;
@@ -3327,6 +3368,7 @@ bge_attach(device_t dev)
 
 	/* Save chipset family. */
 	switch (sc->bge_asicrev) {
+	case BGE_ASICREV_BCM5762:
 	case BGE_ASICREV_BCM57765:
 	case BGE_ASICREV_BCM57766:
 		sc->bge_flags |= BGE_FLAG_57765_PLUS;
@@ -3387,6 +3429,7 @@ bge_attach(device_t dev)
 	case BGE_ASICREV_BCM5719:
 	case BGE_ASICREV_BCM5720:
 	case BGE_ASICREV_BCM5761:
+	case BGE_ASICREV_BCM5762:
 		sc->bge_flags |= BGE_FLAG_APE;
 		break;
 	}
@@ -5451,7 +5494,8 @@ bge_init_locked(struct bge_softc *sc)

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307200819.r6K8J1q3066842>