Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jun 2016 06:22:49 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r302121 - in projects/vnet: . lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/riscv/sys...
Message-ID:  <201606230622.u5N6Mnr1001655@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bz
Date: Thu Jun 23 06:22:48 2016
New Revision: 302121
URL: https://svnweb.freebsd.org/changeset/base/302121

Log:
  MfH @r302119
  
  Includes the pf CVE fix.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  projects/vnet/lib/libc/sys/pipe.c
     - copied unchanged from r302119, head/lib/libc/sys/pipe.c
Deleted:
  projects/vnet/lib/libc/aarch64/sys/pipe.S
  projects/vnet/lib/libc/amd64/sys/pipe.S
  projects/vnet/lib/libc/arm/sys/pipe.S
  projects/vnet/lib/libc/i386/sys/pipe.S
  projects/vnet/lib/libc/mips/sys/pipe.S
  projects/vnet/lib/libc/powerpc/sys/pipe.S
  projects/vnet/lib/libc/powerpc64/sys/pipe.S
  projects/vnet/lib/libc/riscv/sys/pipe.S
  projects/vnet/lib/libc/sparc64/sys/pipe.S
Modified:
  projects/vnet/Makefile
  projects/vnet/lib/libc/aarch64/sys/Makefile.inc
  projects/vnet/lib/libc/amd64/sys/Makefile.inc
  projects/vnet/lib/libc/arm/sys/Makefile.inc
  projects/vnet/lib/libc/i386/sys/Makefile.inc
  projects/vnet/lib/libc/mips/sys/Makefile.inc
  projects/vnet/lib/libc/powerpc/sys/Makefile.inc
  projects/vnet/lib/libc/powerpc64/sys/Makefile.inc
  projects/vnet/lib/libc/riscv/sys/Makefile.inc
  projects/vnet/lib/libc/sparc64/sys/Makefile.inc
  projects/vnet/lib/libc/sys/Makefile.inc
  projects/vnet/lib/libc/sys/pipe.2
  projects/vnet/share/mk/bsd.README
  projects/vnet/share/mk/bsd.sys.mk
  projects/vnet/sys/compat/freebsd32/freebsd32_misc.c
  projects/vnet/sys/compat/freebsd32/freebsd32_proto.h
  projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h
  projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c
  projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c
  projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c
  projects/vnet/sys/compat/freebsd32/syscalls.master
  projects/vnet/sys/compat/svr4/svr4_filio.c
  projects/vnet/sys/compat/svr4/svr4_proto.h
  projects/vnet/sys/compat/svr4/svr4_syscall.h
  projects/vnet/sys/compat/svr4/svr4_syscallnames.c
  projects/vnet/sys/compat/svr4/svr4_sysent.c
  projects/vnet/sys/compat/svr4/syscalls.master
  projects/vnet/sys/dev/ath/if_athvar.h
  projects/vnet/sys/dev/bhnd/bcma/bcma.c
  projects/vnet/sys/dev/bhnd/bhnd_core.h
  projects/vnet/sys/dev/bhnd/bhndb/bhndb.c
  projects/vnet/sys/dev/cxgbe/adapter.h
  projects/vnet/sys/dev/cxgbe/t4_main.c
  projects/vnet/sys/dev/cxgbe/t4_netmap.c
  projects/vnet/sys/dev/cxgbe/t4_sge.c
  projects/vnet/sys/dev/iwm/if_iwm.c
  projects/vnet/sys/dev/iwm/if_iwm_mac_ctxt.c
  projects/vnet/sys/dev/iwm/if_iwm_phy_db.c
  projects/vnet/sys/dev/iwm/if_iwm_phy_db.h
  projects/vnet/sys/dev/iwm/if_iwm_scan.c
  projects/vnet/sys/dev/iwm/if_iwm_util.c
  projects/vnet/sys/geom/geom_subr.c
  projects/vnet/sys/geom/mirror/g_mirror.c
  projects/vnet/sys/kern/init_sysent.c
  projects/vnet/sys/kern/makesyscalls.sh
  projects/vnet/sys/kern/sys_pipe.c
  projects/vnet/sys/kern/syscalls.c
  projects/vnet/sys/kern/syscalls.master
  projects/vnet/sys/kern/systrace_args.c
  projects/vnet/sys/netpfil/pf/pf_ioctl.c
  projects/vnet/sys/sys/proc.h
  projects/vnet/sys/sys/syscall.h
  projects/vnet/sys/sys/syscall.mk
  projects/vnet/sys/sys/sysproto.h
  projects/vnet/sys/vm/vm_glue.c
  projects/vnet/sys/vm/vm_pageout.c
Directory Properties:
  projects/vnet/   (props changed)

Modified: projects/vnet/Makefile
==============================================================================
--- projects/vnet/Makefile	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/Makefile	Thu Jun 23 06:22:48 2016	(r302121)
@@ -150,9 +150,9 @@ TGTS+=	${BITGTS}
 # the ones that benefit from it.
 META_TGT_WHITELIST+= \
 	_* build32 buildfiles buildincludes buildkernel buildsoft \
-	buildworld everything kernel-toolchains kernel kernels libraries \
-	native-xtools showconfig tinderbox toolchain toolchains universe \
-	world worlds xdev xdev-build
+	buildworld everything kernel-toolchain kernel-toolchains kernel \
+	kernels libraries native-xtools showconfig tinderbox toolchain \
+	toolchains universe world worlds xdev xdev-build
 
 .ORDER: buildworld installworld
 .ORDER: buildworld distributeworld

Modified: projects/vnet/lib/libc/aarch64/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/aarch64/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/aarch64/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -6,7 +6,6 @@ SRCS+=	__vdso_gettc.c
 
 #MDASM= ptrace.S
 MDASM=	cerror.S \
-	pipe.S \
 	shmat.S \
 	sigreturn.S \
 	syscall.S \

Modified: projects/vnet/lib/libc/amd64/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/amd64/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/amd64/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -4,7 +4,7 @@
 SRCS+=	amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \
 	amd64_set_gsbase.c __vdso_gettc.c
 
-MDASM=	vfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \
+MDASM=	vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \
 	sbrk.S setlogin.S sigreturn.S
 
 # Don't generate default code for these syscalls:

Modified: projects/vnet/lib/libc/arm/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/arm/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/arm/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -2,7 +2,7 @@
 
 SRCS+=	__vdso_gettc.c
 
-MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
+MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S
 
 # Don't generate default code for these syscalls:
 NOASM=	break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o

Modified: projects/vnet/lib/libc/i386/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/i386/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/i386/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -8,7 +8,7 @@ SRCS+=	i386_get_fsbase.c i386_get_gsbase
 	i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \
 	__vdso_gettc.c
 
-MDASM=	Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \
+MDASM=	Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \
 	sbrk.S setlogin.S sigreturn.S syscall.S
 
 # Don't generate default code for these syscalls:

Modified: projects/vnet/lib/libc/mips/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/mips/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/mips/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
 SRCS+=	trivial-vdso_tc.c
 
 MDASM=  Ovfork.S brk.S cerror.S exect.S \
-	pipe.S ptrace.S sbrk.S syscall.S
+	ptrace.S sbrk.S syscall.S
 
 # Don't generate default code for these syscalls:
 NOASM=	break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o

Modified: projects/vnet/lib/libc/powerpc/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/powerpc/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/powerpc/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-MDASM+=	brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
+MDASM+=	brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S
 
 # Don't generate default code for these syscalls:
 NOASM=	break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o

Modified: projects/vnet/lib/libc/powerpc64/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/powerpc64/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/powerpc64/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-MDASM+=	brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S
+MDASM+=	brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S
 
 # Don't generate default code for these syscalls:
 NOASM=	break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o

Modified: projects/vnet/lib/libc/riscv/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/riscv/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/riscv/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -4,7 +4,6 @@ SRCS+=	trivial-vdso_tc.c
 
 #MDASM= ptrace.S
 MDASM=	cerror.S \
-	pipe.S \
 	shmat.S \
 	sigreturn.S \
 	syscall.S \

Modified: projects/vnet/lib/libc/sparc64/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/sparc64/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/sparc64/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -12,7 +12,7 @@ SRCS+=	__sparc_sigtramp_setup.c \
 
 CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu
 
-MDASM+=	brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S
+MDASM+=	brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S
 
 # Don't generate default code for these syscalls:
 NOASM=	break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o

Modified: projects/vnet/lib/libc/sys/Makefile.inc
==============================================================================
--- projects/vnet/lib/libc/sys/Makefile.inc	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/sys/Makefile.inc	Thu Jun 23 06:22:48 2016	(r302121)
@@ -28,6 +28,8 @@ SRCS+= futimens.c utimensat.c
 NOASM+= futimens.o utimensat.o
 PSEUDO+= _futimens.o _utimensat.o
 
+SRCS+= pipe.c
+
 INTERPOSED = \
 	accept \
 	accept4 \

Modified: projects/vnet/lib/libc/sys/pipe.2
==============================================================================
--- projects/vnet/lib/libc/sys/pipe.2	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/lib/libc/sys/pipe.2	Thu Jun 23 06:22:48 2016	(r302121)
@@ -28,7 +28,7 @@
 .\"     @(#)pipe.2	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd May 1, 2013
+.Dd June 22, 2016
 .Dt PIPE 2
 .Os
 .Sh NAME
@@ -118,6 +118,9 @@ and
 .Fn pipe2
 system calls will fail if:
 .Bl -tag -width Er
+.It Bq Er EFAULT
+.Ar fildes
+argument points to an invalid memory location.
 .It Bq Er EMFILE
 Too many descriptors are active.
 .It Bq Er ENFILE

Copied: projects/vnet/lib/libc/sys/pipe.c (from r302119, head/lib/libc/sys/pipe.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ projects/vnet/lib/libc/sys/pipe.c	Thu Jun 23 06:22:48 2016	(r302121, copy of r302119, head/lib/libc/sys/pipe.c)
@@ -0,0 +1,47 @@
+/*-
+ * Copyright (c) 2016 SRI International
+ * All rights reserved.
+ *
+ * This software was developed by SRI International and the University of
+ * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
+ * ("CTSRD"), as part of the DARPA CRASH research programme.
+ *
+ * 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 <sys/cdefs.h>
+
+#include <unistd.h>
+
+__weak_reference(__sys_pipe, pipe);
+__weak_reference(__sys_pipe, _pipe);
+
+extern int __sys_pipe2(int fildes[2], int flags);
+
+int
+__sys_pipe(int fildes[2])
+{
+
+	return (__sys_pipe2(fildes, 0));
+}

Modified: projects/vnet/share/mk/bsd.README
==============================================================================
--- projects/vnet/share/mk/bsd.README	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/share/mk/bsd.README	Thu Jun 23 06:22:48 2016	(r302121)
@@ -120,6 +120,8 @@ object.
 
 The following variables are common:
 
+AFLAGS.${SRC}
+		Flags dependent on source file name.
 ACFLAGS.${SRC}
 		Flags dependent on source file name.
 CFLAGS.${SRC}
@@ -255,6 +257,11 @@ It has seven targets:
 
 It sets/uses the following variables:
 
+AFLAGS		Flags to the assembler when assembling .s files.
+
+ACFLAGS		Flags to the compiler when preprocessing and
+		assembling .S files.
+
 BINGRP		Binary group.
 
 BINOWN		Binary owner.

Modified: projects/vnet/share/mk/bsd.sys.mk
==============================================================================
--- projects/vnet/share/mk/bsd.sys.mk	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/share/mk/bsd.sys.mk	Thu Jun 23 06:22:48 2016	(r302121)
@@ -174,6 +174,7 @@ CFLAGS+=	${CWARNFLAGS.${.IMPSRC:T}}
 CFLAGS+=	 ${CFLAGS.${COMPILER_TYPE}}
 CXXFLAGS+=	 ${CXXFLAGS.${COMPILER_TYPE}}
 
+AFLAGS+=	${AFLAGS.${.IMPSRC:T}}
 ACFLAGS+=	${ACFLAGS.${.IMPSRC:T}}
 CFLAGS+=	${CFLAGS.${.IMPSRC:T}}
 CXXFLAGS+=	${CXXFLAGS.${.IMPSRC:T}}

Modified: projects/vnet/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- projects/vnet/sys/compat/freebsd32/freebsd32_misc.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/freebsd32_misc.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -272,6 +272,15 @@ freebsd4_freebsd32_getfsstat(struct thre
 }
 #endif
 
+#ifdef COMPAT_FREEBSD10
+int
+freebsd10_freebsd32_pipe(struct thread *td,
+    struct freebsd10_freebsd32_pipe_args *uap) {
+	
+	return (freebsd10_pipe(td, (struct freebsd10_pipe_args*)uap));
+}
+#endif
+
 int
 freebsd32_sigaltstack(struct thread *td,
 		      struct freebsd32_sigaltstack_args *uap)

Modified: projects/vnet/sys/compat/freebsd32/freebsd32_proto.h
==============================================================================
--- projects/vnet/sys/compat/freebsd32/freebsd32_proto.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/freebsd32_proto.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks 
  */
 
 #ifndef _FREEBSD32_SYSPROTO_H_
@@ -61,6 +61,9 @@ struct freebsd32_recvfrom_args {
 	char from_l_[PADL_(uint32_t)]; uint32_t from; char from_r_[PADR_(uint32_t)];
 	char fromlenaddr_l_[PADL_(uint32_t)]; uint32_t fromlenaddr; char fromlenaddr_r_[PADR_(uint32_t)];
 };
+struct freebsd10_freebsd32_pipe_args {
+	register_t dummy;
+};
 struct ofreebsd32_sigpending_args {
 	register_t dummy;
 };
@@ -1099,6 +1102,28 @@ int	freebsd7_freebsd32_shmctl(struct thr
 
 #endif /* COMPAT_FREEBSD7 */
 
+
+#ifdef COMPAT_FREEBSD10
+
+#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__))
+#define PAD64_REQUIRED
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
+#ifdef PAD64_REQUIRED
+#else
+#endif
+int	freebsd10_freebsd32_pipe(struct thread *, struct freebsd10_freebsd32_pipe_args *);
+
+#endif /* COMPAT_FREEBSD10 */
+
 #define	FREEBSD32_SYS_AUE_freebsd32_wait4	AUE_WAIT4
 #define	FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat	AUE_GETFSSTAT
 #define	FREEBSD32_SYS_AUE_ofreebsd32_lseek	AUE_LSEEK
@@ -1107,6 +1132,7 @@ int	freebsd7_freebsd32_shmctl(struct thr
 #define	FREEBSD32_SYS_AUE_freebsd32_recvfrom	AUE_RECVFROM
 #define	FREEBSD32_SYS_AUE_ofreebsd32_stat	AUE_STAT
 #define	FREEBSD32_SYS_AUE_ofreebsd32_lstat	AUE_LSTAT
+#define	FREEBSD32_SYS_AUE_freebsd10_freebsd32_pipe	AUE_PIPE
 #define	FREEBSD32_SYS_AUE_ofreebsd32_sigaction	AUE_SIGACTION
 #define	FREEBSD32_SYS_AUE_ofreebsd32_sigprocmask	AUE_SIGPROCMASK
 #define	FREEBSD32_SYS_AUE_ofreebsd32_sigpending	AUE_SIGPENDING

Modified: projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h
==============================================================================
--- projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/freebsd32_syscall.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks 
  */
 
 #define	FREEBSD32_SYS_syscall	0
@@ -48,7 +48,7 @@
 #define	FREEBSD32_SYS_getppid	39
 				/* 40 is old freebsd32_lstat */
 #define	FREEBSD32_SYS_dup	41
-#define	FREEBSD32_SYS_pipe	42
+				/* 42 is freebsd10 freebsd32_pipe */
 #define	FREEBSD32_SYS_getegid	43
 #define	FREEBSD32_SYS_profil	44
 #define	FREEBSD32_SYS_ktrace	45

Modified: projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c
==============================================================================
--- projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/freebsd32_syscalls.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks 
  */
 
 const char *freebsd32_syscallnames[] = {
@@ -52,7 +52,7 @@ const char *freebsd32_syscallnames[] = {
 	"getppid",			/* 39 = getppid */
 	"compat.freebsd32_lstat",		/* 40 = old freebsd32_lstat */
 	"dup",			/* 41 = dup */
-	"pipe",			/* 42 = pipe */
+	"compat10.freebsd32_pipe",		/* 42 = freebsd10 freebsd32_pipe */
 	"getegid",			/* 43 = getegid */
 	"profil",			/* 44 = profil */
 	"ktrace",			/* 45 = ktrace */

Modified: projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c
==============================================================================
--- projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/freebsd32_sysent.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb 
+ * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks 
  */
 
 #include "opt_compat.h"
@@ -42,6 +42,12 @@
 #define compat7(n, name) 0, (sy_call_t *)nosys
 #endif
 
+#ifdef COMPAT_FREEBSD10
+#define compat10(n, name) n, (sy_call_t *)__CONCAT(freebsd10_,name)
+#else
+#define compat10(n, name) 0, (sy_call_t *)nosys
+#endif
+
 /* The casts are bogus but will do for now. */
 struct sysent freebsd32_sysent[] = {
 #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__))
@@ -89,7 +95,7 @@ struct sysent freebsd32_sysent[] = {
 	{ 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, 0, SY_THR_STATIC },	/* 39 = getppid */
 	{ compat(AS(ofreebsd32_lstat_args),freebsd32_lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC },	/* 40 = old freebsd32_lstat */
 	{ AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC },	/* 41 = dup */
-	{ 0, (sy_call_t *)sys_pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC },		/* 42 = pipe */
+	{ compat10(0,freebsd32_pipe), AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC },		/* 42 = freebsd10 freebsd32_pipe */
 	{ 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, 0, SY_THR_STATIC },	/* 43 = getegid */
 	{ AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC },	/* 44 = profil */
 	{ AS(ktrace_args), (sy_call_t *)sys_ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC },	/* 45 = ktrace */

Modified: projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c
==============================================================================
--- projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/freebsd32_systrace_args.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -293,11 +293,6 @@ systrace_args(int sysnum, void *params, 
 		*n_args = 1;
 		break;
 	}
-	/* pipe */
-	case 42: {
-		*n_args = 0;
-		break;
-	}
 	/* getegid */
 	case 43: {
 		*n_args = 0;
@@ -3768,9 +3763,6 @@ systrace_entry_setargdesc(int sysnum, in
 			break;
 		};
 		break;
-	/* pipe */
-	case 42:
-		break;
 	/* getegid */
 	case 43:
 		break;
@@ -9083,8 +9075,6 @@ systrace_return_setargdesc(int sysnum, i
 		if (ndx == 0 || ndx == 1)
 			p = "int";
 		break;
-	/* pipe */
-	case 42:
 	/* getegid */
 	case 43:
 	/* profil */

Modified: projects/vnet/sys/compat/freebsd32/syscalls.master
==============================================================================
--- projects/vnet/sys/compat/freebsd32/syscalls.master	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/freebsd32/syscalls.master	Thu Jun 23 06:22:48 2016	(r302121)
@@ -29,6 +29,7 @@
 ;	COMPAT4	included on COMPAT4 #ifdef (FreeBSD 4 compat)
 ;	COMPAT6	included on COMPAT6 #ifdef (FreeBSD 6 compat)
 ;	COMPAT7	included on COMPAT7 #ifdef (FreeBSD 7 compat)
+;	COMPAT10 included on COMPAT10 #ifdef (FreeBSD 10 compat)
 ;	OBSOL	obsolete, not included in system, only specifies name
 ;	UNIMPL	not implemented, placeholder only
 ;	NOSTD	implemented but as a lkm that can be statically
@@ -124,7 +125,7 @@
 40	AUE_LSTAT	COMPAT	{ int freebsd32_lstat(char *path, \
 				    struct ostat *ub); }
 41	AUE_DUP		NOPROTO	{ int dup(u_int fd); }
-42	AUE_PIPE	NOPROTO	{ int pipe(void); }
+42	AUE_PIPE	COMPAT10	{ int freebsd32_pipe(void); }
 43	AUE_GETEGID	NOPROTO	{ gid_t getegid(void); }
 44	AUE_PROFILE	NOPROTO	{ int profil(caddr_t samples, size_t size, \
 				    size_t offset, u_int scale); }

Modified: projects/vnet/sys/compat/svr4/svr4_filio.c
==============================================================================
--- projects/vnet/sys/compat/svr4/svr4_filio.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/svr4/svr4_filio.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/mutex.h>
 
 #include <sys/sysproto.h>
+#include <sys/syscallsubr.h>
 
 #include <compat/svr4/svr4.h>
 #include <compat/svr4/svr4_types.h>
@@ -250,3 +251,19 @@ svr4_fil_ioctl(fp, td, retval, fd, cmd, 
 		return 0;	/* ENOSYS really */
 	}
 }
+
+int
+svr4_pipe(struct thread *td, struct svr4_pipe_args *uap) {
+	int error;
+	int fildes[2];
+
+	error = kern_pipe(td, fildes, 0, NULL, NULL);
+	if (error)
+	return (error);
+
+	td->td_retval[0] = fildes[0];
+	td->td_retval[1] = fildes[1];
+
+	return (0);
+}
+

Modified: projects/vnet/sys/compat/svr4/svr4_proto.h
==============================================================================
--- projects/vnet/sys/compat/svr4/svr4_proto.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/svr4/svr4_proto.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed 
+ * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks 
  */
 
 #ifndef _SVR4_SYSPROTO_H_
@@ -12,8 +12,10 @@
 #include <sys/signal.h>
 #include <sys/acl.h>
 #include <sys/cpuset.h>
+#include <sys/_ffcounter.h>
 #include <sys/_semaphore.h>
 #include <sys/ucontext.h>
+#include <sys/wait.h>
 
 #include <bsm/audit_kevents.h>
 
@@ -93,6 +95,9 @@ struct svr4_sys_pgrpsys_args {
 	char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)];
 	char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)];
 };
+struct svr4_pipe_args {
+	register_t dummy;
+};
 struct svr4_sys_times_args {
 	char tp_l_[PADL_(struct tms *)]; struct tms * tp; char tp_r_[PADR_(struct tms *)];
 };
@@ -422,6 +427,7 @@ int	svr4_sys_access(struct thread *, str
 int	svr4_sys_nice(struct thread *, struct svr4_sys_nice_args *);
 int	svr4_sys_kill(struct thread *, struct svr4_sys_kill_args *);
 int	svr4_sys_pgrpsys(struct thread *, struct svr4_sys_pgrpsys_args *);
+int	svr4_pipe(struct thread *, struct svr4_pipe_args *);
 int	svr4_sys_times(struct thread *, struct svr4_sys_times_args *);
 int	svr4_sys_signal(struct thread *, struct svr4_sys_signal_args *);
 int	svr4_sys_msgsys(struct thread *, struct svr4_sys_msgsys_args *);
@@ -509,6 +515,12 @@ int	svr4_sys_sendto(struct thread *, str
 
 #endif /* COMPAT_FREEBSD7 */
 
+
+#ifdef COMPAT_FREEBSD10
+
+
+#endif /* COMPAT_FREEBSD10 */
+
 #define	SVR4_SYS_AUE_svr4_sys_open	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_wait	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_creat	AUE_NULL
@@ -525,6 +537,7 @@ int	svr4_sys_sendto(struct thread *, str
 #define	SVR4_SYS_AUE_svr4_sys_nice	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_kill	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_pgrpsys	AUE_NULL
+#define	SVR4_SYS_AUE_svr4_pipe	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_times	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_signal	AUE_NULL
 #define	SVR4_SYS_AUE_svr4_sys_msgsys	AUE_NULL

Modified: projects/vnet/sys/compat/svr4/svr4_syscall.h
==============================================================================
--- projects/vnet/sys/compat/svr4/svr4_syscall.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/svr4/svr4_syscall.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed 
+ * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks 
  */
 
 #define	SVR4_SYS_exit	1
@@ -38,7 +38,7 @@
 #define	SVR4_SYS_svr4_sys_kill	37
 #define	SVR4_SYS_svr4_sys_pgrpsys	39
 #define	SVR4_SYS_dup	41
-#define	SVR4_SYS_pipe	42
+#define	SVR4_SYS_svr4_pipe	42
 #define	SVR4_SYS_svr4_sys_times	43
 #define	SVR4_SYS_setgid	46
 #define	SVR4_SYS_getgid	47

Modified: projects/vnet/sys/compat/svr4/svr4_syscallnames.c
==============================================================================
--- projects/vnet/sys/compat/svr4/svr4_syscallnames.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/svr4/svr4_syscallnames.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed 
+ * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks 
  */
 
 const char *svr4_syscallnames[] = {
@@ -49,7 +49,7 @@ const char *svr4_syscallnames[] = {
 	"svr4_sys_pgrpsys",			/* 39 = svr4_sys_pgrpsys */
 	"#40",			/* 40 = xenix */
 	"dup",			/* 41 = dup */
-	"pipe",			/* 42 = pipe */
+	"svr4_pipe",			/* 42 = svr4_pipe */
 	"svr4_sys_times",			/* 43 = svr4_sys_times */
 	"#44",			/* 44 = profil */
 	"#45",			/* 45 = plock */

Modified: projects/vnet/sys/compat/svr4/svr4_sysent.c
==============================================================================
--- projects/vnet/sys/compat/svr4/svr4_sysent.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/svr4/svr4_sysent.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -3,7 +3,7 @@
  *
  * DO NOT EDIT-- this file is automatically generated.
  * $FreeBSD$
- * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed 
+ * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks 
  */
 
 #include <sys/types.h>
@@ -61,7 +61,7 @@ struct sysent svr4_sysent[] = {
 	{ AS(svr4_sys_pgrpsys_args), (sy_call_t *)svr4_sys_pgrpsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 39 = svr4_sys_pgrpsys */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 40 = xenix */
 	{ AS(dup_args), (sy_call_t *)sys_dup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 41 = dup */
-	{ 0, (sy_call_t *)sys_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },		/* 42 = pipe */
+	{ 0, (sy_call_t *)svr4_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },		/* 42 = svr4_pipe */
 	{ AS(svr4_sys_times_args), (sy_call_t *)svr4_sys_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC },	/* 43 = svr4_sys_times */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 44 = profil */
 	{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT },			/* 45 = plock */

Modified: projects/vnet/sys/compat/svr4/syscalls.master
==============================================================================
--- projects/vnet/sys/compat/svr4/syscalls.master	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/compat/svr4/syscalls.master	Thu Jun 23 06:22:48 2016	(r302121)
@@ -87,7 +87,7 @@
 				    int pgid); }
 40	AUE_NULL	UNIMPL	xenix
 41	AUE_NULL	NOPROTO	{ int dup(u_int fd); }
-42	AUE_NULL	NOPROTO	{ int pipe(void); }
+42	AUE_NULL	STD	{ int svr4_pipe(void); }
 43	AUE_NULL	STD	{ int svr4_sys_times(struct tms *tp); }
 44	AUE_NULL	UNIMPL	profil
 45	AUE_NULL	UNIMPL	plock

Modified: projects/vnet/sys/dev/ath/if_athvar.h
==============================================================================
--- projects/vnet/sys/dev/ath/if_athvar.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/dev/ath/if_athvar.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -370,9 +370,9 @@ struct ath_txq {
 	 */
 	struct {
 		TAILQ_HEAD(axq_q_f_s, ath_buf)	axq_q;
-		u_int				axq_depth;
+		u_int				axq_depth;	/* how many frames (1 per legacy, 1 per A-MPDU list) are in the FIFO queue */
 	} fifo;
-	u_int			axq_fifo_depth;	/* depth of FIFO frames */
+	u_int			axq_fifo_depth;	/* how many FIFO slots are active */
 
 	/*
 	 * XXX the holdingbf field is protected by the TXBUF lock

Modified: projects/vnet/sys/dev/bhnd/bcma/bcma.c
==============================================================================
--- projects/vnet/sys/dev/bhnd/bcma/bcma.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/dev/bhnd/bcma/bcma.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 
 #include "bcma_eromreg.h"
 #include "bcma_eromvar.h"
+#include <dev/bhnd/bhnd_core.h>
 
 int
 bcma_probe(device_t dev)
@@ -218,9 +219,33 @@ bcma_reset_core(device_t dev, device_t c
 	if (dinfo->res_agent == NULL)
 		return (ENODEV);
 
-	// TODO - perform reset
+	/* Start reset */
+	bhnd_bus_write_4(dinfo->res_agent, BHND_RESET_CF, BHND_RESET_CF_ENABLE);
+	bhnd_bus_read_4(dinfo->res_agent, BHND_RESET_CF);
+	DELAY(10);
+
+	/* Disable clock */
+	bhnd_bus_write_4(dinfo->res_agent, BHND_CF, flags);
+	bhnd_bus_read_4(dinfo->res_agent, BHND_CF);
+	DELAY(10);
+
+	/* Enable clocks & force clock gating */
+	bhnd_bus_write_4(dinfo->res_agent, BHND_CF, BHND_CF_CLOCK_EN |
+	    BHND_CF_FGC | flags);
+	bhnd_bus_read_4(dinfo->res_agent, BHND_CF);
+	DELAY(10);
+
+	/* Complete reset */
+	bhnd_bus_write_4(dinfo->res_agent, BHND_RESET_CF, 0);
+	bhnd_bus_read_4(dinfo->res_agent, BHND_RESET_CF);
+	DELAY(10);
+
+	/* Release force clock gating */
+	bhnd_bus_write_4(dinfo->res_agent, BHND_CF, BHND_CF_CLOCK_EN | flags);
+	bhnd_bus_read_4(dinfo->res_agent, BHND_CF);
+	DELAY(10);
 
-	return (ENXIO);
+	return (0);
 }
 
 static int

Modified: projects/vnet/sys/dev/bhnd/bhnd_core.h
==============================================================================
--- projects/vnet/sys/dev/bhnd/bhnd_core.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/dev/bhnd/bhnd_core.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -25,19 +25,27 @@
 #define _BHND_BHND_CORE_H_
 
 /* Common core control flags */
-#define	BHND_CF_BIST_EN		0x8000		/**< ??? */
+#define	BHND_CF 		0x0408
+#define	BHND_CF_BIST_EN		0x8000		/**< built-in self test */
 #define	BHND_CF_PME_EN		0x4000		/**< ??? */
 #define	BHND_CF_CORE_BITS	0x3ffc		/**< core specific flag mask */
 #define	BHND_CF_FGC		0x0002		/**< force clock gating */
 #define	BHND_CF_CLOCK_EN	0x0001		/**< enable clock */
 
 /* Common core status flags */
+#define	BHND_SF			0x0500
 #define	BHND_SF_BIST_DONE	0x8000		/**< ??? */
 #define	BHND_SF_BIST_ERROR	0x4000		/**< ??? */
 #define	BHND_SF_GATED_CLK	0x2000		/**< clock gated */
 #define	BHND_SF_DMA64		0x1000		/**< supports 64-bit DMA */
 #define	BHND_SF_CORE_BITS	0x0fff		/**< core-specific status mask */
 
+/*Reset core control flags */
+#define	BHND_RESET_CF		0x0800
+#define	BHND_RESET_CF_ENABLE	0x0001
+
+#define	BHND_RESET_SF		0x0804
+
 /* 
  * A register that is common to all cores to
  * communicate w/PMU regarding clock control.

Modified: projects/vnet/sys/dev/bhnd/bhndb/bhndb.c
==============================================================================
--- projects/vnet/sys/dev/bhnd/bhndb/bhndb.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/dev/bhnd/bhndb/bhndb.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -596,8 +596,10 @@ bhndb_generic_init_full_config(device_t 
 	hostb = NULL;
 
 	/* Fetch the full set of bhnd-attached cores */
-	if ((error = device_get_children(sc->bus_dev, &devs, &ndevs)))
+	if ((error = device_get_children(sc->bus_dev, &devs, &ndevs))) {
+		device_printf(sc->dev, "unable to get children\n");
 		return (error);
+	}
 
 	/* Find our host bridge device */
 	hostb = BHNDB_FIND_HOSTB_DEVICE(dev, child);

Modified: projects/vnet/sys/dev/cxgbe/adapter.h
==============================================================================
--- projects/vnet/sys/dev/cxgbe/adapter.h	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/dev/cxgbe/adapter.h	Thu Jun 23 06:22:48 2016	(r302121)
@@ -208,7 +208,6 @@ enum {
 	INTR_RXQ	= (1 << 4),	/* All NIC rxq's take interrupts */
 	INTR_OFLD_RXQ	= (1 << 5),	/* All TOE rxq's take interrupts */
 	INTR_ALL	= (INTR_RXQ | INTR_OFLD_RXQ),
-	VI_NETMAP	= (1 << 6),
 
 	/* adapter debug_flags */
 	DF_DUMP_MBOX	= (1 << 0),
@@ -230,7 +229,7 @@ struct vi_info {
 	unsigned long flags;
 	int if_flags;
 
-	uint16_t *rss;
+	uint16_t *rss, *nm_rss;
 	uint16_t viid;
 	int16_t  xact_addr_filt;/* index of exact MAC address filter */
 	uint16_t rss_size;	/* size of VI's RSS table slice */
@@ -251,6 +250,10 @@ struct vi_info {
 	int first_ofld_txq;	/* index of first offload tx queue */
 	int nofldrxq;		/* # of offload rx queues */
 	int first_ofld_rxq;	/* index of first offload rx queue */
+	int nnmtxq;
+	int first_nm_txq;
+	int nnmrxq;
+	int first_nm_rxq;
 	int tmr_idx;
 	int pktc_idx;
 	int qsize_rxq;
@@ -362,6 +365,11 @@ enum {
 	IQS_DISABLED	= 0,
 	IQS_BUSY	= 1,
 	IQS_IDLE	= 2,
+
+	/* netmap related flags */
+	NM_OFF	= 0,
+	NM_ON	= 1,
+	NM_BUSY	= 2,
 };
 
 /*
@@ -765,8 +773,11 @@ struct adapter {
 	struct irq {
 		struct resource *res;
 		int rid;
+		volatile int nm_state;	/* NM_OFF, NM_ON, or NM_BUSY */
 		void *tag;
-	} *irq;
+		struct sge_rxq *rxq;
+		struct sge_nm_rxq *nm_rxq;
+	} __aligned(CACHE_LINE_SIZE) *irq;
 
 	bus_dma_tag_t dmat;	/* Parent DMA tag */
 
@@ -911,11 +922,11 @@ struct adapter {
 	for (q = &vi->pi->adapter->sge.ofld_rxq[vi->first_ofld_rxq], iter = 0; \
 	    iter < vi->nofldrxq; ++iter, ++q)
 #define for_each_nm_txq(vi, iter, q) \
-	for (q = &vi->pi->adapter->sge.nm_txq[vi->first_txq], iter = 0; \
-	    iter < vi->ntxq; ++iter, ++q)
+	for (q = &vi->pi->adapter->sge.nm_txq[vi->first_nm_txq], iter = 0; \
+	    iter < vi->nnmtxq; ++iter, ++q)
 #define for_each_nm_rxq(vi, iter, q) \
-	for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_rxq], iter = 0; \
-	    iter < vi->nrxq; ++iter, ++q)
+	for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_nm_rxq], iter = 0; \
+	    iter < vi->nnmrxq; ++iter, ++q)
 #define for_each_vi(_pi, _iter, _vi) \
 	for ((_vi) = (_pi)->vi, (_iter) = 0; (_iter) < (_pi)->nvi; \
 	     ++(_iter), ++(_vi))
@@ -1087,8 +1098,8 @@ void vi_tick(void *);
 
 #ifdef DEV_NETMAP
 /* t4_netmap.c */
-int create_netmap_ifnet(struct port_info *);
-int destroy_netmap_ifnet(struct port_info *);
+void cxgbe_nm_attach(struct vi_info *);
+void cxgbe_nm_detach(struct vi_info *);
 void t4_nm_intr(void *);
 #endif
 
@@ -1109,6 +1120,7 @@ int t4_setup_vi_queues(struct vi_info *)
 int t4_teardown_vi_queues(struct vi_info *);
 void t4_intr_all(void *);
 void t4_intr(void *);
+void t4_vi_intr(void *);
 void t4_intr_err(void *);
 void t4_intr_evt(void *);
 void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *);

Modified: projects/vnet/sys/dev/cxgbe/t4_main.c
==============================================================================
--- projects/vnet/sys/dev/cxgbe/t4_main.c	Thu Jun 23 06:18:32 2016	(r302120)
+++ projects/vnet/sys/dev/cxgbe/t4_main.c	Thu Jun 23 06:22:48 2016	(r302121)
@@ -230,6 +230,14 @@ TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1
 static int t4_nrxq1g = -1;
 TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g);
 
+#define NTXQ_VI 1
+static int t4_ntxq_vi = -1;
+TUNABLE_INT("hw.cxgbe.ntxq_vi", &t4_ntxq_vi);
+
+#define NRXQ_VI 1
+static int t4_nrxq_vi = -1;
+TUNABLE_INT("hw.cxgbe.nrxq_vi", &t4_nrxq_vi);
+
 static int t4_rsrv_noflowq = 0;
 TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq);
 
@@ -249,24 +257,24 @@ TUNABLE_INT("hw.cxgbe.nofldtxq1g", &t4_n
 #define NOFLDRXQ_1G 1
 static int t4_nofldrxq1g = -1;
 TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_nofldrxq1g);
+
+#define NOFLDTXQ_VI 1
+static int t4_nofldtxq_vi = -1;
+TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi);
+
+#define NOFLDRXQ_VI 1
+static int t4_nofldrxq_vi = -1;
+TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi);
 #endif
 
 #ifdef DEV_NETMAP
-#define NNMTXQ_10G 2
-static int t4_nnmtxq10g = -1;
-TUNABLE_INT("hw.cxgbe.nnmtxq10g", &t4_nnmtxq10g);
-
-#define NNMRXQ_10G 2
-static int t4_nnmrxq10g = -1;
-TUNABLE_INT("hw.cxgbe.nnmrxq10g", &t4_nnmrxq10g);
-
-#define NNMTXQ_1G 1
-static int t4_nnmtxq1g = -1;
-TUNABLE_INT("hw.cxgbe.nnmtxq1g", &t4_nnmtxq1g);
-
-#define NNMRXQ_1G 1
-static int t4_nnmrxq1g = -1;
-TUNABLE_INT("hw.cxgbe.nnmrxq1g", &t4_nnmrxq1g);
+#define NNMTXQ_VI 2
+static int t4_nnmtxq_vi = -1;
+TUNABLE_INT("hw.cxgbe.nnmtxq_vi", &t4_nnmtxq_vi);
+
+#define NNMRXQ_VI 2
+static int t4_nnmrxq_vi = -1;
+TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi);
 #endif
 
 /*
@@ -387,18 +395,18 @@ struct intrs_and_queues {
 	uint16_t ntxq1g;	/* # of NIC txq's for each 1G port */
 	uint16_t nrxq1g;	/* # of NIC rxq's for each 1G port */
 	uint16_t rsrv_noflowq;	/* Flag whether to reserve queue 0 */
-#ifdef TCP_OFFLOAD
 	uint16_t nofldtxq10g;	/* # of TOE txq's for each 10G port */
 	uint16_t nofldrxq10g;	/* # of TOE rxq's for each 10G port */
 	uint16_t nofldtxq1g;	/* # of TOE txq's for each 1G port */
 	uint16_t nofldrxq1g;	/* # of TOE rxq's for each 1G port */
-#endif
-#ifdef DEV_NETMAP
-	uint16_t nnmtxq10g;	/* # of netmap txq's for each 10G port */
-	uint16_t nnmrxq10g;	/* # of netmap rxq's for each 10G port */
-	uint16_t nnmtxq1g;	/* # of netmap txq's for each 1G port */
-	uint16_t nnmrxq1g;	/* # of netmap rxq's for each 1G port */
-#endif
+
+	/* The vcxgbe/vcxl interfaces use these and not the ones above. */
+	uint16_t ntxq_vi;	/* # of NIC txq's */
+	uint16_t nrxq_vi;	/* # of NIC rxq's */
+	uint16_t nofldtxq_vi;	/* # of TOE txq's */
+	uint16_t nofldrxq_vi;	/* # of TOE rxq's */
+	uint16_t nnmtxq_vi;	/* # of netmap txq's */
+	uint16_t nnmrxq_vi;	/* # of netmap rxq's */
 };
 
 struct filter_entry {
@@ -802,10 +810,10 @@ t4_attach(device_t dev)
 		goto done; /* error message displayed already */
 
 	/*
-	 * Number of VIs to create per-port.  The first VI is the
-	 * "main" regular VI for the port.  The second VI is used for
-	 * netmap if present, and any remaining VIs are used for
-	 * additional virtual interfaces.
+	 * Number of VIs to create per-port.  The first VI is the "main" regular
+	 * VI for the port.  The rest are additional virtual interfaces on the
+	 * same physical port.  Note that the main VI does not have native
+	 * netmap support but the extra VIs do.
 	 *
 	 * Limit the number of VIs per port to the number of available
 	 * MAC addresses per port.
@@ -814,9 +822,6 @@ t4_attach(device_t dev)
 		num_vis = t4_num_vis;
 	else
 		num_vis = 1;
-#ifdef DEV_NETMAP
-	num_vis++;
-#endif
 	if (num_vis > nitems(vi_mac_funcs)) {
 		num_vis = nitems(vi_mac_funcs);
 		device_printf(dev, "Number of VIs limited to %d\n", num_vis);
@@ -831,7 +836,6 @@ t4_attach(device_t dev)
 	n10g = n1g = 0;
 	for_each_port(sc, i) {
 		struct port_info *pi;
-		struct vi_info *vi;
 
 		pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK);
 		sc->port[i] = pi;
@@ -839,7 +843,10 @@ t4_attach(device_t dev)
 		/* These must be set before t4_port_init */
 		pi->adapter = sc;
 		pi->port_id = i;
-		pi->nvi = num_vis;
+		/*
+		 * XXX: vi[0] is special so we can't delay this allocation until
+		 * pi->nvi's final value is known.
+		 */
 		pi->vi = malloc(sizeof(struct vi_info) * num_vis, M_CXGBE,
 		    M_ZERO | M_WAITOK);
 
@@ -881,26 +888,12 @@ t4_attach(device_t dev)
 
 		if (is_10G_port(pi) || is_40G_port(pi)) {
 			n10g++;
-			for_each_vi(pi, j, vi) {
-				vi->tmr_idx = t4_tmr_idx_10g;
-				vi->pktc_idx = t4_pktc_idx_10g;
-			}
 		} else {
 			n1g++;
-			for_each_vi(pi, j, vi) {
-				vi->tmr_idx = t4_tmr_idx_1g;
-				vi->pktc_idx = t4_pktc_idx_1g;
-			}
 		}
 
 		pi->linkdnrc = -1;
 
-		for_each_vi(pi, j, vi) {
-			vi->qsize_rxq = t4_qsize_rxq;
-			vi->qsize_txq = t4_qsize_txq;
-			vi->pi = pi;
-		}
-
 		pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbe" : "cxl", -1);
 		if (pi->dev == NULL) {
 			device_printf(dev,
@@ -915,12 +908,11 @@ t4_attach(device_t dev)
 	/*
 	 * Interrupt type, # of interrupts, # of rx/tx queues, etc.
 	 */
-#ifdef DEV_NETMAP
-	num_vis--;
-#endif
 	rc = cfg_itype_and_nqueues(sc, n10g, n1g, num_vis, &iaq);
 	if (rc != 0)
 		goto done; /* error message displayed already */
+	if (iaq.nrxq_vi + iaq.nofldrxq_vi + iaq.nnmrxq_vi == 0)
+		num_vis = 1;
 
 	sc->intr_type = iaq.intr_type;
 	sc->intr_count = iaq.nirq;
@@ -929,8 +921,8 @@ t4_attach(device_t dev)
 	s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g;
 	s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g;
 	if (num_vis > 1) {
-		s->nrxq += (n10g + n1g) * (num_vis - 1);
-		s->ntxq += (n10g + n1g) * (num_vis - 1);
+		s->nrxq += (n10g + n1g) * (num_vis - 1) * iaq.nrxq_vi;
+		s->ntxq += (n10g + n1g) * (num_vis - 1) * iaq.ntxq_vi;
 	}
 	s->neq = s->ntxq + s->nrxq;	/* the free list in an rxq is an eq */
 	s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */
@@ -940,8 +932,10 @@ t4_attach(device_t dev)
 		s->nofldrxq = n10g * iaq.nofldrxq10g + n1g * iaq.nofldrxq1g;
 		s->nofldtxq = n10g * iaq.nofldtxq10g + n1g * iaq.nofldtxq1g;
 		if (num_vis > 1) {
-			s->nofldrxq += (n10g + n1g) * (num_vis - 1);
-			s->nofldtxq += (n10g + n1g) * (num_vis - 1);
+			s->nofldrxq += (n10g + n1g) * (num_vis - 1) *
+			    iaq.nofldrxq_vi;
+			s->nofldtxq += (n10g + n1g) * (num_vis - 1) *
+			    iaq.nofldtxq_vi;
 		}
 		s->neq += s->nofldtxq + s->nofldrxq;
 		s->niq += s->nofldrxq;
@@ -953,8 +947,10 @@ t4_attach(device_t dev)
 	}
 #endif
 #ifdef DEV_NETMAP
-	s->nnmrxq = n10g * iaq.nnmrxq10g + n1g * iaq.nnmrxq1g;
-	s->nnmtxq = n10g * iaq.nnmtxq10g + n1g * iaq.nnmtxq1g;
+	if (num_vis > 1) {
+		s->nnmrxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmrxq_vi;
+		s->nnmtxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmtxq_vi;
+	}
 	s->neq += s->nnmtxq + s->nnmrxq;
 	s->niq += s->nnmrxq;
 
@@ -998,62 +994,64 @@ t4_attach(device_t dev)
 		if (pi == NULL)
 			continue;
 
+		pi->nvi = num_vis;
 		for_each_vi(pi, j, vi) {
-#ifdef DEV_NETMAP
-			if (j == 1) {
-				vi->flags |= VI_NETMAP | INTR_RXQ;

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



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