CVS commit: src/sys/netipsec

2018-04-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Apr 17 06:23:30 UTC 2018

Modified Files:
src/sys/netipsec: ipsec_mbuf.c

Log Message:
Don't assume M_PKTHDR is set only on the first mbuf of the chain. It
should, but it looks like there are several places that can put M_PKTHDR
on secondary mbufs (PR/53189), so drop this assumption right now to
prevent further bugs.

The check is replaced by (m1 != m), which is equivalent to the previous
code: we want to modify m->m_pkthdr.len only when 'm' was not passed in
m_adj().


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/netipsec/ipsec_mbuf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/ipsec_mbuf.c
diff -u src/sys/netipsec/ipsec_mbuf.c:1.22 src/sys/netipsec/ipsec_mbuf.c:1.23
--- src/sys/netipsec/ipsec_mbuf.c:1.22	Sat Mar 10 17:52:50 2018
+++ src/sys/netipsec/ipsec_mbuf.c	Tue Apr 17 06:23:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_mbuf.c,v 1.22 2018/03/10 17:52:50 maxv Exp $	*/
+/*	$NetBSD: ipsec_mbuf.c,v 1.23 2018/04/17 06:23:30 maxv Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.22 2018/03/10 17:52:50 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.23 2018/04/17 06:23:30 maxv Exp $");
 
 /*
  * IPsec-specific mbuf routines.
@@ -400,7 +400,7 @@ m_striphdr(struct mbuf *m, int skip, int
 		/* The header was at the beginning of the mbuf */
 		IPSEC_STATINC(IPSEC_STAT_INPUT_FRONT);
 		m_adj(m1, hlen);
-		if ((m1->m_flags & M_PKTHDR) == 0)
+		if (m1 != m)
 			m->m_pkthdr.len -= hlen;
 	} else if (roff + hlen >= m1->m_len) {
 		struct mbuf *mo;
@@ -425,7 +425,7 @@ m_striphdr(struct mbuf *m, int skip, int
 
 		/* ...and trim the end of the first part of the chain...sick */
 		m_adj(m1, -(m1->m_len - roff));
-		if ((m1->m_flags & M_PKTHDR) == 0)
+		if (m1 != m)
 			m->m_pkthdr.len -= (m1->m_len - roff);
 
 		/* Finally, let's relink */



CVS commit: [pgoyette-compat] src/doc

2018-04-16 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Apr 17 06:20:26 UTC 2018

Modified Files:
src/doc [pgoyette-compat]: COMPAT-branch-notes

Log Message:
More updates to match reality.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/doc/COMPAT-branch-notes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/COMPAT-branch-notes
diff -u src/doc/COMPAT-branch-notes:1.1.2.10 src/doc/COMPAT-branch-notes:1.1.2.11
--- src/doc/COMPAT-branch-notes:1.1.2.10	Mon Apr 16 09:53:02 2018
+++ src/doc/COMPAT-branch-notes	Tue Apr 17 06:20:26 2018
@@ -32,6 +32,14 @@ DONE
 module status to userland has been versioned and moved to the
 compat_80 module.
 
+9.  The old monolithic compat module has been broken into multiple
+modules, one for each old NetBSD version.  The monolithic module
+is still available, and uses the alias mechanism to "advertise"
+that the component modules are available.
+
+There are still several areas which are not complete - see the
+TODO list below for more details.
+
 
 TODO
 
@@ -39,70 +47,45 @@ TODO
 COMPAT_xx.  When found, move the actual compat code into the compat
 hierarchy and replace originals with indirect (vectored) calls.
 
-2.  Using the alias mechanism, split compat (and perhaps compat_sysv)
-into multiple version-specific modules.  Note that in addition to
-updating the module code, this would also require changes to
-syscalls.master files to change the names of the modules associated
-with module-provided syscalls.
-
-Update:  These are being done simultaneously, with compat code being
-moved directly to a version-specific module.  All of COMPAT_80 and
-COMPAT_70, most of COMPAT_60, and much of COMPAT_50 are finished.
-Still need to decide how to handle the COMPAT_BSDPTY stuff.
+2.  Similar to the monolithic netbsd module, split the compat_sysv
+module into multiple version-specific modules.
 
-COMPAT_40 is also finished, except for some arch/sh3 MD code.  There
-is also some arch/m68k MD-specific code remaining for COMPAT_50.
+3.  Update syscalls.master to reflect that modular syscalls are now
+provided by version-specific modules.
 
-3.  XXX The compat_60 module still needs some work for XEN systems.
+4.  The rtsock compat code is a disaster, with rtsock_50.c #include-ing
+the main rtsock.c code with various manipulations of the COMPAT_50
+macro.
+
+5.  The compat_60 module still needs some work for XEN systems.  We
+probably need some build infrastructure changes to ensure that
+XEN (and, for i386, XEN-PAE) modules are build with the correct
+macros defined and with -I directories specified in the same order
+as for building kernels.
 
-4.  Update syscalls.master to point the compat calls at the specific
+6.  Update syscalls.master to point the compat calls at the specific
 modules rather than the monolithic compat module.  Update the
 "required" lists of other modules, too.
 
-5.  The rtsock compatability code needs to be de-spaghetti'd and made
+7.  The rtsock compatability code needs to be de-spaghetti'd and made
 separable into rtsock_70 and rtsock_50 pieces.
 
-6.  Once rtsock is separated, compat_14 references to rtsock_50 routines
+8.  Once rtsock is separated, compat_14 references to rtsock_50 routines
 needs to be verified.
 
-7.  For compat_60, still need to figure out what to do with BSDPTY and
+9.  For compat_60, still need to figure out what to do with BSDPTY and
 tty_ptm
 
-8.  Also for compat_60, need to fix the building of XEN (and, for i386,
+10. Also for compat_60, need to fix the building of XEN (and, for i386,
 XEN-PAE) module variants so that the obj-dir symlinks and the -I
 include order match those present in a kernel build.  See PR/53130
 (Currently, this affects the compat_60 module and its implementation
 of microcode updates for AMD processors - i386 and amd64.)
 
-9.  For compat_50, in addition to rtsock there are some things in dev/vnd,
+11. For compat_50, in addition to rtsock there are some things in dev/vnd,
 dev/gpio, and dev/wscons/wsmux that I haven't been able to cleanly
 separate.
 
-10. In addition to the ttcompat code in compat_60, there is another
-ttcompat in compat_43.  The 60 code used to simply update the function
-pointer, but the 43 code uses a rw_lock to protect the pointer update.
-Additionally, the 43 code specifically checks to ensure that the
-initial value of the pointer in NULL before updating it, which would
-prevent the 43 code from working if the 60 code is already loaded.  (I
-have some XXX comment in my branch code for this.)
-
-I suspect that the right this to do here is probably to make _two_
-indirect function calls in the main tty code, use separate pointers
-for the 60 and 43 compat stuff, and

CVS commit: src/sys/dev/pci/ixgbe

2018-04-16 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Tue Apr 17 05:23:58 UTC 2018

Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h

Log Message:
Fix panic when "sysctl -w hw.ixg0.txrx_workqueue=[01]" while there is traffic.

The operation is not supported, however causing panic is problem.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/ixgbe/ixgbe.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.146 src/sys/dev/pci/ixgbe/ixgbe.c:1.147
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.146	Thu Apr 12 08:03:55 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Tue Apr 17 05:23:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.146 2018/04/12 08:03:55 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.147 2018/04/17 05:23:58 knakahara Exp $ */
 
 /**
 
@@ -2487,7 +2487,7 @@ static inline void
 ixgbe_sched_handle_que(struct adapter *adapter, struct ix_queue *que)
 {
 
-	if (adapter->txrx_use_workqueue) {
+	if(que->txrx_use_workqueue) {
 		/*
 		 * adapter->que_wq is bound to each CPU instead of
 		 * each NIC queue to reduce workqueue kthread. As we
@@ -2531,6 +2531,12 @@ ixgbe_msix_que(void *arg)
 	ixgbe_disable_queue(adapter, que->msix);
 	++que->irqs.ev_count;
 
+	/*
+	 * Don't change "que->txrx_use_workqueue" from this point to avoid
+	 * flip-flopping softint/workqueue mode in one deferred processing.
+	 */
+	que->txrx_use_workqueue = adapter->txrx_use_workqueue;
+
 #ifdef __NetBSD__
 	/* Don't run ixgbe_rxeof in interrupt context */
 	more = true;
@@ -3174,6 +3180,16 @@ ixgbe_add_device_sysctls(struct adapter 
 	CTL_EOL) != 0)
 		aprint_error_dev(dev, "could not create sysctl\n");
 
+	/*
+	 * If each "que->txrx_use_workqueue" is changed in sysctl handler,
+	 * it causesflip-flopping softint/workqueue mode in one deferred
+	 * processing. Therefore, preempt_disable()/preempt_enable() are
+	 * required in ixgbe_sched_handle_que() to avoid
+	 * KASSERT(ixgbe_sched_handle_que()) in softint_schedule().
+	 * I think changing "que->txrx_use_workqueue" in interrupt handler
+	 * is lighter than doing preempt_disable()/preempt_enable() in every
+	 * ixgbe_sched_handle_que().
+	 */
 	adapter->txrx_use_workqueue = ixgbe_txrx_workqueue;
 	if (sysctl_createv(log, 0, &rnode, &cnode, CTLFLAG_READWRITE,
 	CTLTYPE_BOOL, "txrx_workqueue", SYSCTL_DESCR("Use workqueue for packet processing"),
@@ -4798,6 +4814,11 @@ ixgbe_legacy_irq(void *arg)
 	}
 
 	if ((ifp->if_flags & IFF_RUNNING) != 0) {
+		/*
+		 * The same as ixgbe_msix_que() about "que->txrx_use_workqueue".
+		 */
+		que->txrx_use_workqueue = adapter->txrx_use_workqueue;
+
 #ifdef __NetBSD__
 		/* Don't run ixgbe_rxeof in interrupt context */
 		more = true;

Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.41 src/sys/dev/pci/ixgbe/ixgbe.h:1.42
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.41	Wed Apr  4 08:13:07 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.h	Tue Apr 17 05:23:58 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.41 2018/04/04 08:13:07 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.42 2018/04/17 05:23:58 knakahara Exp $ */
 
 /**
   SPDX-License-Identifier: BSD-3-Clause
@@ -346,6 +346,7 @@ struct ix_queue {
 	 * > 0 : this queue is disabled
 	 *   the value is ixgbe_disable_queue() called count
 	 */
+	bool txrx_use_workqueue;
 };
 
 /*



CVS commit: src/sys/netipsec

2018-04-16 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Tue Apr 17 04:22:59 UTC 2018

Modified Files:
src/sys/netipsec: key.c

Log Message:
Fix panic of SADB when the state of sav is changed in timeout

pointed out by ozaki-r@n.o, thanks


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/netipsec/key.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.252 src/sys/netipsec/key.c:1.253
--- src/sys/netipsec/key.c:1.252	Mon Apr 16 08:56:08 2018
+++ src/sys/netipsec/key.c	Tue Apr 17 04:22:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.252 2018/04/16 08:56:08 yamaguchi Exp $	*/
+/*	$NetBSD: key.c,v 1.253 2018/04/17 04:22:58 yamaguchi Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.252 2018/04/16 08:56:08 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.253 2018/04/17 04:22:58 yamaguchi Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -418,6 +418,8 @@ static struct {
 	PSLIST_READER_NEXT((sav), struct secasvar, pslist_entry)
 
 /* Macros for key_sad.savlut */
+#define SAVLUT_ENTRY_INIT(sav)		\
+	PSLIST_ENTRY_INIT((sav), pslist_entry_savlut)
 #define SAVLUT_READER_FOREACH(sav, dst, proto, hash_key)		\
 	PSLIST_READER_FOREACH((sav),	\
 	&key_sad.savlut[key_savluthash(dst, proto, hash_key,		\
@@ -1432,6 +1434,7 @@ key_init_sav(struct secasvar *sav)
 
 	localcount_init(&sav->localcount);
 	SAVLIST_ENTRY_INIT(sav);
+	SAVLUT_ENTRY_INIT(sav);
 }
 
 u_int



CVS commit: src/tools

2018-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 17 02:03:56 UTC 2018

Modified Files:
src/tools: Makefile.gnuhost

Log Message:
Use the __clang__ preprocessor symbol to check for clang, since --version
might barf. From joerg@


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/tools/Makefile.gnuhost

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tools/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.46 src/tools/Makefile.gnuhost:1.47
--- src/tools/Makefile.gnuhost:1.46	Sun Apr 15 17:50:38 2018
+++ src/tools/Makefile.gnuhost	Mon Apr 16 22:03:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.46 2018/04/15 21:50:38 christos Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.47 2018/04/17 02:03:56 christos Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -24,7 +24,7 @@ HOST_CFLAGS+=-O2 -no-cpp-precomp
 .endif
 
 # GCC build exceeds the clang default bracket nesting level of 256.
-HOST_COMPILER_CLANG != if ${HOST_CC} --version 2>&1 | grep -q -s clang; then echo yes; else echo no; fi
+HOST_COMPILER_CLANG != if echo __clang__ | ${HOST_CC} -E - | grep -q clang; then echo no; else echo yes; fi
 .if ${HOST_COMPILER_CLANG} == "yes"
 HOST_CFLAGS+= -fbracket-depth=512
 HOST_CXXFLAGS+= -fbracket-depth=512



CVS commit: [pgoyette-compat] src

2018-04-16 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Apr 17 00:02:59 UTC 2018

Modified Files:
src/distrib/sets/lists/modules [pgoyette-compat]: mi
src/sys/compat/common [pgoyette-compat]: compat_mod.c compat_mod.h
files.common kern_exit_43.c kern_info_09.c kern_info_43.c
kern_resource_43.c kern_sig_43.c tty_43.c uipc_syscalls_43.c
vfs_syscalls_10.c vfs_syscalls_43.c vm_43.c
src/sys/modules [pgoyette-compat]: Makefile
src/sys/sys [pgoyette-compat]: vfs_syscalls.h
Added Files:
src/sys/modules/compat_09 [pgoyette-compat]: Makefile
src/sys/modules/compat_10 [pgoyette-compat]: Makefile
src/sys/modules/compat_43 [pgoyette-compat]: Makefile

Log Message:
First pass at compat modules for 4.3BSD, NetBSD-0.9, and NetBSD-1.0

XXX Still need to deal with the sysctl stuff and other code shared
XXX between 09 and 43


To generate a diff of this commit:
cvs rdiff -u -r1.114.2.14 -r1.114.2.15 src/distrib/sets/lists/modules/mi
cvs rdiff -u -r1.24.14.32 -r1.24.14.33 src/sys/compat/common/compat_mod.c
cvs rdiff -u -r1.1.42.19 -r1.1.42.20 src/sys/compat/common/compat_mod.h
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/sys/compat/common/files.common
cvs rdiff -u -r1.22 -r1.22.62.1 src/sys/compat/common/kern_exit_43.c
cvs rdiff -u -r1.20 -r1.20.96.1 src/sys/compat/common/kern_info_09.c
cvs rdiff -u -r1.35 -r1.35.28.1 src/sys/compat/common/kern_info_43.c
cvs rdiff -u -r1.21 -r1.21.96.1 src/sys/compat/common/kern_resource_43.c
cvs rdiff -u -r1.34 -r1.34.56.1 src/sys/compat/common/kern_sig_43.c
cvs rdiff -u -r1.30 -r1.30.26.1 src/sys/compat/common/tty_43.c
cvs rdiff -u -r1.47.14.1 -r1.47.14.2 src/sys/compat/common/uipc_syscalls_43.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/compat/common/vfs_syscalls_10.c
cvs rdiff -u -r1.62.2.1 -r1.62.2.2 src/sys/compat/common/vfs_syscalls_43.c
cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/compat/common/vm_43.c
cvs rdiff -u -r1.202.2.18 -r1.202.2.19 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sys/modules/compat_09/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sys/modules/compat_10/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/sys/modules/compat_43/Makefile
cvs rdiff -u -r1.23.2.1 -r1.23.2.2 src/sys/sys/vfs_syscalls.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.114.2.14 src/distrib/sets/lists/modules/mi:1.114.2.15
--- src/distrib/sets/lists/modules/mi:1.114.2.14	Sat Mar 31 09:17:35 2018
+++ src/distrib/sets/lists/modules/mi	Tue Apr 17 00:02:58 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.114.2.14 2018/03/31 09:17:35 pgoyette Exp $
+# $NetBSD: mi,v 1.114.2.15 2018/04/17 00:02:58 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -70,6 +70,10 @@
 ./@MODULEDIR@/compat/compat.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_util			base-kernel-modules	kmod
 ./@MODULEDIR@/compat_util/compat_util.kmod	base-kernel-modules	kmod
+./@MODULEDIR@/compat_09base-kernel-modules	kmod
+./@MODULEDIR@/compat_09/compat_09.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/compat_10base-kernel-modules	kmod
+./@MODULEDIR@/compat_10/compat_10.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_12base-kernel-modules	kmod
 ./@MODULEDIR@/compat_12/compat_12.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_13base-kernel-modules	kmod
@@ -84,6 +88,8 @@
 ./@MODULEDIR@/compat_30/compat_30.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_40base-kernel-modules	kmod
 ./@MODULEDIR@/compat_40/compat_40.kmod		base-kernel-modules	kmod
+./@MODULEDIR@/compat_43base-kernel-modules	kmod
+./@MODULEDIR@/compat_43/compat_43.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_50base-kernel-modules	kmod
 ./@MODULEDIR@/compat_50/compat_50.kmod		base-kernel-modules	kmod
 ./@MODULEDIR@/compat_60base-kernel-modules	kmod

Index: src/sys/compat/common/compat_mod.c
diff -u src/sys/compat/common/compat_mod.c:1.24.14.32 src/sys/compat/common/compat_mod.c:1.24.14.33
--- src/sys/compat/common/compat_mod.c:1.24.14.32	Mon Apr 16 01:59:56 2018
+++ src/sys/compat/common/compat_mod.c	Tue Apr 17 00:02:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_mod.c,v 1.24.14.32 2018/04/16 01:59:56 pgoyette Exp $	*/
+/*	$NetBSD: compat_mod.c,v 1.24.14.33 2018/04/17 00:02:58 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,14 +34,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.32 2018/04/16 01:59:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_mod.c,v 1.24.14.33 2018/04/17 00:02:58 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
 #include "opt_compat_43.h"
-#include "opt_ntp.h"
-#include "opt_sysv.h"
-#include "opt_lfs.h"
 #endif
 
 #include 
@@ -53,86 +50,24 @@ __KERNEL_RCSID(0, "$NetBSD: compat_mod.c
 #include 
 #include 
 #include 
-#include 

CVS commit: src/sys/dev/ata

2018-04-16 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Mon Apr 16 22:33:28 UTC 2018

Modified Files:
src/sys/dev/ata: atavar.h

Log Message:
remove superfluous semicolon


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/dev/ata/atavar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/atavar.h
diff -u src/sys/dev/ata/atavar.h:1.95 src/sys/dev/ata/atavar.h:1.96
--- src/sys/dev/ata/atavar.h:1.95	Tue Oct 17 18:52:50 2017
+++ src/sys/dev/ata/atavar.h	Mon Apr 16 22:33:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: atavar.h,v 1.95 2017/10/17 18:52:50 jdolecek Exp $	*/
+/*	$NetBSD: atavar.h,v 1.96 2018/04/16 22:33:28 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -522,7 +522,7 @@ int	ata_read_log_ext_ncq(struct ata_driv
 #define CMD_AGAIN 2
 
 struct ata_xfer *ata_get_xfer_ext(struct ata_channel *, int, uint8_t);
-#define ata_get_xfer(chp) ata_get_xfer_ext((chp), C_WAIT, 0);
+#define ata_get_xfer(chp) ata_get_xfer_ext((chp), C_WAIT, 0)
 void	ata_free_xfer(struct ata_channel *, struct ata_xfer *);
 void	ata_deactivate_xfer(struct ata_channel *, struct ata_xfer *);
 void	ata_exec_xfer(struct ata_channel *, struct ata_xfer *);



CVS commit: src/sys/miscfs/procfs

2018-04-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 16 20:27:38 UTC 2018

Modified Files:
src/sys/miscfs/procfs: procfs_subr.c

Log Message:
Change procfs_revoke_vnodes() to use vrecycle()/vgone() instead
of VOP_REVOKE().

Gets rid of a bunch of suspensions on /proc as vrecycle() will
succeed most time and we suspend at most once per call.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/miscfs/procfs/procfs_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/miscfs/procfs/procfs_subr.c
diff -u src/sys/miscfs/procfs/procfs_subr.c:1.111 src/sys/miscfs/procfs/procfs_subr.c:1.112
--- src/sys/miscfs/procfs/procfs_subr.c:1.111	Sun Dec 31 03:29:18 2017
+++ src/sys/miscfs/procfs/procfs_subr.c	Mon Apr 16 20:27:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: procfs_subr.c,v 1.111 2017/12/31 03:29:18 christos Exp $	*/
+/*	$NetBSD: procfs_subr.c,v 1.112 2018/04/16 20:27:38 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -102,13 +102,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.111 2017/12/31 03:29:18 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_subr.c,v 1.112 2018/04/16 20:27:38 hannken Exp $");
 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -368,6 +369,8 @@ procfs_revoke_selector(void *arg, struct
 void
 procfs_revoke_vnodes(struct proc *p, void *arg)
 {
+	int error;
+	bool suspended;
 	struct vnode *vp;
 	struct vnode_iterator *marker;
 	struct mount *mp = (struct mount *)arg;
@@ -375,14 +378,29 @@ procfs_revoke_vnodes(struct proc *p, voi
 	if (!(p->p_flag & PK_SUGID))
 		return;
 
+	suspended = false;
 	vfs_vnode_iterator_init(mp, &marker);
 
 	while ((vp = vfs_vnode_iterator_next(marker,
 	procfs_revoke_selector, p)) != NULL) {
-		VOP_REVOKE(vp, REVOKEALL);
-		vrele(vp);
+		if (vrecycle(vp))
+			continue;
+		/* Vnode is busy, we have to suspend the mount for vgone(). */
+		while (! suspended) {
+			error = vfs_suspend(mp, 0);
+			if (error == 0) {
+suspended = true;
+			} else if (error != EINTR && error != ERESTART) {
+KASSERT(error == EOPNOTSUPP);
+break;
+			}
+		}
+		vgone(vp);
 	}
 
+	if (suspended)
+		vfs_resume(mp);
+
 	vfs_vnode_iterator_destroy(marker);
 }
 



CVS commit: src/sys/kern

2018-04-16 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Mon Apr 16 20:25:21 UTC 2018

Modified Files:
src/sys/kern: subr_pserialize.c

Log Message:
Function pserialize_perform() usually succeeds after two cross calls
so defer kpause() to iterations three and above.

Speeds up VOP_REVOKE() on /proc/XXX/status by a factor of ~12.

Ok: core@


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/subr_pserialize.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_pserialize.c
diff -u src/sys/kern/subr_pserialize.c:1.10 src/sys/kern/subr_pserialize.c:1.11
--- src/sys/kern/subr_pserialize.c:1.10	Thu Dec 28 03:39:48 2017
+++ src/sys/kern/subr_pserialize.c	Mon Apr 16 20:25:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_pserialize.c,v 1.10 2017/12/28 03:39:48 msaitoh Exp $	*/
+/*	$NetBSD: subr_pserialize.c,v 1.11 2018/04/16 20:25:21 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.10 2017/12/28 03:39:48 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pserialize.c,v 1.11 2018/04/16 20:25:21 hannken Exp $");
 
 #include 
 
@@ -146,6 +146,7 @@ pserialize_destroy(pserialize_t psz)
 void
 pserialize_perform(pserialize_t psz)
 {
+	int n;
 	uint64_t xc;
 
 	KASSERT(!cpu_intr_p());
@@ -176,6 +177,7 @@ pserialize_perform(pserialize_t psz)
 	TAILQ_INSERT_TAIL(&psz_queue0, psz, psz_chain);
 	psz_work_todo++;
 
+	n = 0;
 	do {
 		mutex_spin_exit(&psz_lock);
 
@@ -183,9 +185,10 @@ pserialize_perform(pserialize_t psz)
 		 * Force some context switch activity on every CPU, as
 		 * the system may not be busy.  Pause to not flood.
 		 */
+		if (n++ > 1)
+			kpause("psrlz", false, 1, NULL);
 		xc = xc_broadcast(XC_HIGHPRI, (xcfunc_t)nullop, NULL, NULL);
 		xc_wait(xc);
-		kpause("psrlz", false, 1, NULL);
 
 		mutex_spin_enter(&psz_lock);
 	} while (!kcpuset_iszero(psz->psz_target));



CVS commit: src/sys/kern

2018-04-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 16 19:19:51 UTC 2018

Modified Files:
src/sys/kern: uipc_mbuf.c

Log Message:
Disable the M_PKTHDR check for now. It causes PR/53189 (which is also
reproducible on i386).

It seems that someone is giving looutput a malformed chain.


To generate a diff of this commit:
cvs rdiff -u -r1.188 -r1.189 src/sys/kern/uipc_mbuf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/uipc_mbuf.c
diff -u src/sys/kern/uipc_mbuf.c:1.188 src/sys/kern/uipc_mbuf.c:1.189
--- src/sys/kern/uipc_mbuf.c:1.188	Sun Apr 15 07:35:49 2018
+++ src/sys/kern/uipc_mbuf.c	Mon Apr 16 19:19:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_mbuf.c,v 1.188 2018/04/15 07:35:49 maxv Exp $	*/
+/*	$NetBSD: uipc_mbuf.c,v 1.189 2018/04/16 19:19:51 maxv Exp $	*/
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.188 2018/04/15 07:35:49 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.189 2018/04/16 19:19:51 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -1908,9 +1908,11 @@ m_verify_packet(struct mbuf *m)
 		if (__predict_false(n->m_type == MT_FREE)) {
 			panic("%s: mbuf already freed (n = %p)", __func__, n);
 		}
+#if 0	/* Causing PR/53189 */
 		if (__predict_false((n != m) && (n->m_flags & M_PKTHDR) != 0)) {
 			panic("%s: M_PKTHDR set on secondary mbuf", __func__);
 		}
+#endif
 		if (__predict_false(n->m_nextpkt != NULL)) {
 			panic("%s: m_nextpkt not null (m_nextpkt = %p)",
 			__func__, n->m_nextpkt);



CVS commit: src/sys/netipsec

2018-04-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Mon Apr 16 17:32:34 UTC 2018

Modified Files:
src/sys/netipsec: xform_ah.c

Log Message:
Remove dead code.

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/netipsec/xform_ah.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.88 src/sys/netipsec/xform_ah.c:1.89
--- src/sys/netipsec/xform_ah.c:1.88	Fri Apr 13 09:34:20 2018
+++ src/sys/netipsec/xform_ah.c	Mon Apr 16 17:32:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ah.c,v 1.88 2018/04/13 09:34:20 maxv Exp $	*/
+/*	$NetBSD: xform_ah.c,v 1.89 2018/04/16 17:32:34 maxv Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.88 2018/04/13 09:34:20 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.89 2018/04/16 17:32:34 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -299,22 +299,6 @@ ah_massage_headers(struct mbuf **m0, int
 		ip->ip_sum = 0;
 		ip->ip_off = htons(ntohs(ip->ip_off) & ip4_ah_offsetmask);
 
-		/*
-		 * On FreeBSD, ip_off and ip_len assumed in host endian;
-		 * they are converted (if necessary) by ip_input().
-		 * On NetBSD, ip_off and ip_len are in network byte order.
-		 * They must be massaged back to network byte order
-		 * before verifying the  HMAC. Moreover, on FreeBSD,
-		 * we should add `skip' back into the massaged ip_len
-		 * (presumably ip_input() deducted it before we got here?)
-		 * whereas on NetBSD, we should not.
-		 */
-		if (!out) {
-			/* XXX XXX: What are we trying to achieve here? */
-			uint16_t inlen = ntohs(ip->ip_len);
-			ip->ip_len = htons(inlen);
-		}
-
 		if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
 			ip->ip_off &= htons(IP_DF);
 		else



CVS commit: src/external/gpl2/gmake/dist/glob

2018-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 16 16:11:40 UTC 2018

Modified Files:
src/external/gpl2/gmake/dist/glob: glob.c

Log Message:
According to:
https://sourceforge.net/p/predef/wiki/Libraries/
The macro used for old glibc is __GNU_LIBRARY__ and the new one is __GLIBC__.
Try to fix linux compilation by detecting both.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/gmake/dist/glob/glob.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/gmake/dist/glob/glob.c
diff -u src/external/gpl2/gmake/dist/glob/glob.c:1.3 src/external/gpl2/gmake/dist/glob/glob.c:1.4
--- src/external/gpl2/gmake/dist/glob/glob.c:1.3	Mon Apr 16 12:02:57 2018
+++ src/external/gpl2/gmake/dist/glob/glob.c	Mon Apr 16 12:11:40 2018
@@ -207,7 +207,7 @@ my_realloc (p, n)
 #endif /* __GNU_LIBRARY__ */
 
 
-#if !defined __alloca && !defined __GNU_LIBRARY__
+#if !defined __alloca && !(defined __GNU_LIBRARY__ || defined __GLIBC__)
 
 # ifdef	__GNUC__
 #  undef alloca



CVS commit: src/external/gpl2/gmake/dist/glob

2018-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Apr 16 16:02:57 UTC 2018

Modified Files:
src/external/gpl2/gmake/dist/glob: glob.c

Log Message:
Revert previous glob.c change

It broke on !GLIBC.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/gmake/dist/glob/glob.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/gmake/dist/glob/glob.c
diff -u src/external/gpl2/gmake/dist/glob/glob.c:1.2 src/external/gpl2/gmake/dist/glob/glob.c:1.3
--- src/external/gpl2/gmake/dist/glob/glob.c:1.2	Mon Apr 16 14:39:19 2018
+++ src/external/gpl2/gmake/dist/glob/glob.c	Mon Apr 16 16:02:57 2018
@@ -207,7 +207,7 @@ my_realloc (p, n)
 #endif /* __GNU_LIBRARY__ */
 
 
-#if !defined __alloca && defined __GNU_LIBRARY__
+#if !defined __alloca && !defined __GNU_LIBRARY__
 
 # ifdef	__GNUC__
 #  undef alloca



CVS commit: src/share/man/man9

2018-04-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 16 15:02:37 UTC 2018

Modified Files:
src/share/man/man9: fork1.9

Log Message:
Merge EAGAIN descriptions.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/share/man/man9/fork1.9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/fork1.9
diff -u src/share/man/man9/fork1.9:1.15 src/share/man/man9/fork1.9:1.16
--- src/share/man/man9/fork1.9:1.15	Mon Apr 16 14:51:59 2018
+++ src/share/man/man9/fork1.9	Mon Apr 16 15:02:37 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fork1.9,v 1.15 2018/04/16 14:51:59 kamil Exp $
+.\"	$NetBSD: fork1.9,v 1.16 2018/04/16 15:02:37 wiz Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -139,9 +139,8 @@ returns 0.
 Otherwise, the following error values are returned:
 .Bl -tag -width [EAGAIN]
 .It Bq Er EAGAIN
-The limit on the total number of system processes would be exceeded.
-.It Bq Er EAGAIN
-The limit
+The limit on the total number of system processes would be exceeded;
+or the limit
 .Dv RLIMIT_NPROC
 on the total number of processes under execution by this
 user id would be exceeded.



CVS commit: src

2018-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Apr 16 14:52:00 UTC 2018

Modified Files:
src/share/man/man9: fork1.9
src/sys/compat/freebsd: freebsd_fork.c
src/sys/compat/linux/common: linux_sched.c
src/sys/kern: init_main.c kern_fork.c
src/sys/sys: proc.h

Log Message:
Remove the rnewprocp argument from fork1(9)

It's now unused and it can cause use-after-free scenarios as noted by
.

Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg022267.html

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man9/fork1.9
cvs rdiff -u -r1.8 -r1.9 src/sys/compat/freebsd/freebsd_fork.c
cvs rdiff -u -r1.70 -r1.71 src/sys/compat/linux/common/linux_sched.c
cvs rdiff -u -r1.496 -r1.497 src/sys/kern/init_main.c
cvs rdiff -u -r1.203 -r1.204 src/sys/kern/kern_fork.c
cvs rdiff -u -r1.344 -r1.345 src/sys/sys/proc.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man9/fork1.9
diff -u src/share/man/man9/fork1.9:1.14 src/share/man/man9/fork1.9:1.15
--- src/share/man/man9/fork1.9:1.14	Wed Apr 30 13:10:58 2008
+++ src/share/man/man9/fork1.9	Mon Apr 16 14:51:59 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fork1.9,v 1.14 2008/04/30 13:10:58 martin Exp $
+.\"	$NetBSD: fork1.9,v 1.15 2018/04/16 14:51:59 kamil Exp $
 .\"
 .\" Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 4, 2008
+.Dd April 16, 2018
 .Dt FORK1 9
 .Os
 .Sh NAME
@@ -38,7 +38,7 @@
 .In sys/types.h
 .In sys/proc.h
 .Ft int
-.Fn "fork1" "struct lwp *l1" "int flags" "int exitsig" "void *stack" "size_t stacksize" "void (*func)(void *)" "void *arg" "register_t *retval" "struct proc **rnewprocp"
+.Fn "fork1" "struct lwp *l1" "int flags" "int exitsig" "void *stack" "size_t stacksize" "void (*func)(void *)" "void *arg" "register_t *retval"
 .Sh DESCRIPTION
 .Fn fork1
 creates a new process out of the process behind
@@ -132,13 +132,6 @@ User level system call stubs typically s
 and bitwise-AND it with
 .Ar retval[0] ,
 thus returning the pid to the parent process and 0 to the child.
-.Pp
-If
-.Ar rnewprocp
-is not NULL,
-.Ar *rnewprocp
-will point to the newly created process upon successful completion of
-the fork operation.
 .Sh RETURN VALUES
 Upon successful completion of the fork operation,
 .Fn fork1

Index: src/sys/compat/freebsd/freebsd_fork.c
diff -u src/sys/compat/freebsd/freebsd_fork.c:1.8 src/sys/compat/freebsd/freebsd_fork.c:1.9
--- src/sys/compat/freebsd/freebsd_fork.c:1.8	Tue Aug  8 08:04:06 2017
+++ src/sys/compat/freebsd/freebsd_fork.c	Mon Apr 16 14:51:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: freebsd_fork.c,v 1.8 2017/08/08 08:04:06 maxv Exp $	*/
+/*	$NetBSD: freebsd_fork.c,v 1.9 2018/04/16 14:51:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: freebsd_fork.c,v 1.8 2017/08/08 08:04:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: freebsd_fork.c,v 1.9 2018/04/16 14:51:59 kamil Exp $");
 
 #include 
 #include 
@@ -81,5 +81,5 @@ freebsd_sys_rfork(struct lwp *l, const s
 
 	return (fork1(l, flags,
 	SCARG(uap, flags) & FREEBSD_RFLINUXTHPN ? SIGUSR1 : SIGCHLD,
-	NULL, 0, NULL, NULL, retval, NULL));
+	NULL, 0, NULL, NULL, retval));
 }

Index: src/sys/compat/linux/common/linux_sched.c
diff -u src/sys/compat/linux/common/linux_sched.c:1.70 src/sys/compat/linux/common/linux_sched.c:1.71
--- src/sys/compat/linux/common/linux_sched.c:1.70	Sun Apr 15 03:25:25 2018
+++ src/sys/compat/linux/common/linux_sched.c	Mon Apr 16 14:51:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_sched.c,v 1.70 2018/04/15 03:25:25 kamil Exp $	*/
+/*	$NetBSD: linux_sched.c,v 1.71 2018/04/16 14:51:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.70 2018/04/15 03:25:25 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_sched.c,v 1.71 2018/04/16 14:51:59 kamil Exp $");
 
 #include 
 #include 
@@ -158,7 +158,7 @@ linux_sys_clone(struct lwp *l, const str
 	 * that makes this adjustment is a noop.
 	 */
 	if ((error = fork1(l, flags, sig, SCARG(uap, stack), 0,
-	linux_child_return, NULL, retval, NULL)) != 0) {
+	linux_child_return, NULL, retval)) != 0) {
 		DPRINTF(("%s: fork1: error %d\n", __func__, error));
 		return error;
 	}

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.496 src/sys/kern/init_main.c:1.497
--- src/sys/kern/init_main.c:1.496	Mon Apr 16 14:18:16 2018
+++ src/sys/kern/init_main.c	Mon Apr 16 14:51:59 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.496 2018/04/16 14:18:16 kamil Exp $	*/
+/*	$NetBSD: init_main.c,v 1.497 2018/04/16 14:51:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The Net

CVS commit: src/external/gpl2/gmake/dist/glob

2018-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Apr 16 14:39:19 UTC 2018

Modified Files:
src/external/gpl2/gmake/dist/glob: glob.c

Log Message:
Fix build of gmake (in tools) on new GLIBC systems

Reported on Debian and Fedora.

Reference for similar fix:
https://lists.nongnu.org/archive/html/bug-make/2017-11/msg00020.html

Tested by  on Fedora.
Tested by  on Debian.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/gmake/dist/glob/glob.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl2/gmake/dist/glob/glob.c
diff -u src/external/gpl2/gmake/dist/glob/glob.c:1.1.1.1 src/external/gpl2/gmake/dist/glob/glob.c:1.2
--- src/external/gpl2/gmake/dist/glob/glob.c:1.1.1.1	Mon Aug 18 06:47:54 2014
+++ src/external/gpl2/gmake/dist/glob/glob.c	Mon Apr 16 14:39:19 2018
@@ -207,7 +207,7 @@ my_realloc (p, n)
 #endif /* __GNU_LIBRARY__ */
 
 
-#if !defined __alloca && !defined __GNU_LIBRARY__
+#if !defined __alloca && defined __GNU_LIBRARY__
 
 # ifdef	__GNUC__
 #  undef alloca



CVS commit: [netbsd-8] src/doc

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:36:29 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
Tickets #758 - #767


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.183 -r1.1.2.184 src/doc/CHANGES-8.0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.183 src/doc/CHANGES-8.0:1.1.2.184
--- src/doc/CHANGES-8.0:1.1.2.183	Sat Apr 14 11:28:12 2018
+++ src/doc/CHANGES-8.0	Mon Apr 16 14:36:29 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.183 2018/04/14 11:28:12 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.184 2018/04/16 14:36:29 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -12909,3 +12909,78 @@ external/gpl3/gcc.old/usr.bin/gcc/arch/p
 	to make  work.
 	[mrg, ticket #757]
 
+sys/kern/kern_proc.c1.212
+
+	Don't set errno ESRCH for empty result of KINFO_PROC[2].
+	[kamil, ticket #758]
+
+sys/dev/auconv.c1.31 (patch)
+sys/dev/audio.c	1.367,1.369,1.376 (patch),
+		1.377 (patch), 1.378,
+		1.382 (patch),1.383 (patch),
+		1.384,1.388,1.389,
+		1.395,1.396 (patch), 1.397,
+		1.403,1.451,1.452
+sys/dev/audiovar.h1.59 (patch),1.60 (patch)
+sys/dev/aurateconv.c1.21 (patch)
+
+	Various audio fixes.
+	[nat, ticket #759]
+
+sys/dev/isa/gus.c1.112
+
+	Add padding and fix locking.
+	[nat, ticket #760]
+
+sys/dev/isa/sbdsp.c1.137
+
+	Add AUDIO_ENCODING_SLINEAR to supported encodings.
+	This allows sb, sbpro & sb16 to configure with 8-bit precision.
+	[nat, ticket #761]
+
+sys/arch/x86/pci/if_vmx.c			1.22
+
+	Fix calculation of interface statistics counter.
+	[nonaka, ticket #762]
+
+sys/dev/pci/ichsmb.c1.57
+sys/dev/pci/pucdata.c1.101
+
+	ichsmb(4), puc(4): Add Intel 300 series support.
+	[msaitoh, ticket #763]
+
+share/man/man4/wm.41.40
+sys/dev/pci/if_wm.c1.567-1.572
+sys/dev/pci/if_wmreg.h1.106,1.107
+sys/dev/pci/if_wmvar.h1.38
+
+	- Fix a bug that ICH8 B0 stepping might misconfigure the chip from the
+	  NVM image.			  
+	- On PCH_SPT and newer, FLASH access should be done by 32bit. Fix it.
+	- Sync wm_nvm_valid_bank_detect_ich8lan() with FreeBSD r287467.
+	- If the extended configuration size in the EXTCNFSIZE register is 0,
+	  don't continue because it's not required.
+	- Add PCH_CNP support (I219 with Intel 300 series chipset).
+	- Enable all I219 devices by default.
+	- I354 uses an external PHY, so don't use wm_set_eee_i350().
+	  The function is only for internal PHY. 
+	- Sort registers and lowercase hexadecimal value. No functional change.
+	[msaitoh, ticket #764]
+
+sys/dev/isa/wbsio.c1.22
+
+	Handle watchdog attachment in the wbsio_rescan() function, where we
+	take care of other children.
+	[yamaguchi, ticket #765]
+
+sys/netipsec/key.c1.250
+
+	Removed the unnecessary order check of key_lookup_sa.
+	[yamaguchi, ticket #766]
+
+sys/arch/x86/pci/if_vmx.c			1.23,1.24
+
+	vmx(4): handled SIOCZIFDATA. Fix computation of received
+	bytes interface statistics.
+	[nonaka, ticket #767]
+



CVS commit: [netbsd-8] src/sys/arch/x86/pci

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:34:43 UTC 2018

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #767):

sys/arch/x86/pci/if_vmx.c: revision 1.23,1.24

vmx(4): handled SIOCZIFDATA.

vmx(4): compute if_ibytes using rxq->vxrxq_stats.vmrxs_ibytes.


To generate a diff of this commit:
cvs rdiff -u -r1.19.6.3 -r1.19.6.4 src/sys/arch/x86/pci/if_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.19.6.3 src/sys/arch/x86/pci/if_vmx.c:1.19.6.4
--- src/sys/arch/x86/pci/if_vmx.c:1.19.6.3	Mon Apr 16 14:18:53 2018
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Apr 16 14:34:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.19.6.3 2018/04/16 14:18:53 martin Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.19.6.4 2018/04/16 14:34:43 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.3 2018/04/16 14:18:53 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.4 2018/04/16 14:34:43 martin Exp $");
 
 #include 
 #include 
@@ -2892,27 +2892,40 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
 		splx(s);
 		break;
 	case SIOCGIFDATA:
+	case SIOCZIFDATA:
 		ifp->if_ipackets = 0;
+		ifp->if_ibytes = 0;
 		ifp->if_iqdrops = 0;
 		ifp->if_ierrors = 0;
 		for (int i = 0; i < sc->vmx_nrxqueues; i++) {
-			ifp->if_ipackets +=
-			sc->vmx_rxq[i].vxrxq_stats.vmrxs_ipackets;
-			ifp->if_iqdrops +=
-			sc->vmx_rxq[i].vxrxq_stats.vmrxs_iqdrops;
-			ifp->if_ierrors +=
-			sc->vmx_rxq[i].vxrxq_stats.vmrxs_ierrors;
+			struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[i];
+
+			VMXNET3_RXQ_LOCK(rxq);
+			ifp->if_ipackets += rxq->vxrxq_stats.vmrxs_ipackets;
+			ifp->if_ibytes += rxq->vxrxq_stats.vmrxs_ibytes;
+			ifp->if_iqdrops += rxq->vxrxq_stats.vmrxs_iqdrops;
+			ifp->if_ierrors += rxq->vxrxq_stats.vmrxs_ierrors;
+			if (cmd == SIOCZIFDATA) {
+memset(&rxq->vxrxq_stats, 0,
+sizeof(rxq->vxrxq_stats));
+			}
+			VMXNET3_RXQ_UNLOCK(rxq);
 		}
 		ifp->if_opackets = 0;
 		ifp->if_obytes = 0;
 		ifp->if_omcasts = 0;
 		for (int i = 0; i < sc->vmx_ntxqueues; i++) {
-			ifp->if_opackets +=
-			sc->vmx_txq[i].vxtxq_stats.vmtxs_opackets;
-			ifp->if_obytes +=
-			sc->vmx_txq[i].vxtxq_stats.vmtxs_obytes;
-			ifp->if_omcasts +=
-			sc->vmx_txq[i].vxtxq_stats.vmtxs_omcasts;
+			struct vmxnet3_txqueue *txq = &sc->vmx_txq[i];
+
+			VMXNET3_TXQ_LOCK(txq);
+			ifp->if_opackets += txq->vxtxq_stats.vmtxs_opackets;
+			ifp->if_obytes += txq->vxtxq_stats.vmtxs_obytes;
+			ifp->if_omcasts += txq->vxtxq_stats.vmtxs_omcasts;
+			if (cmd == SIOCZIFDATA) {
+memset(&txq->vxtxq_stats, 0,
+sizeof(txq->vxtxq_stats));
+			}
+			VMXNET3_TXQ_UNLOCK(txq);
 		}
 		/* FALLTHROUGH */
 	default:



CVS commit: [netbsd-8] src/sys/netipsec

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:31:44 UTC 2018

Modified Files:
src/sys/netipsec [netbsd-8]: key.c

Log Message:
Pull up following revision(s) (requested by yamaguchi in ticket #766):

sys/netipsec/key.c: revision 1.250

Removed the unnecessary order check of key_lookup_sa

key_prefered_oldsa flag can change the sa to use if an sah
has multiple sav. However the multiple saves whose protocol
is ah, esp, or tcp cannot exist because their duplications
are checked by the spi value. Although the multiple saves
can exist in the case of ipcomp, the values using in the
post processing are same between the saves.

For those reasons, it is no need to select an sav by its
lifetime.

In addition, FreeBSD has already remove this.
reviewed by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.163.2.7 -r1.163.2.8 src/sys/netipsec/key.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.163.2.7 src/sys/netipsec/key.c:1.163.2.8
--- src/sys/netipsec/key.c:1.163.2.7	Wed Mar  7 13:46:41 2018
+++ src/sys/netipsec/key.c	Mon Apr 16 14:31:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.163.2.7 2018/03/07 13:46:41 martin Exp $	*/
+/*	$NetBSD: key.c,v 1.163.2.8 2018/04/16 14:31:44 martin Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.163.2.7 2018/03/07 13:46:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.163.2.8 2018/04/16 14:31:44 martin Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -427,6 +427,12 @@ static const u_int saorder_state_any[] =
 	_i < __arraycount(saorder_state_any) ?		\
 	(s) = saorder_state_any[_i], true : false;		\
 	_i++)
+#define SASTATE_USABLE_FOREACH(s)\
+	for (int _i = 0;	\
+	_i < __arraycount(saorder_state_valid_prefer_new) ?	\
+	(s) = saorder_state_valid_prefer_new[_i],		\
+	true : false;	\
+	_i++)
 
 static const int minsize[] = {
 	sizeof(struct sadb_msg),	/* SADB_EXT_RESERVED */
@@ -1199,9 +1205,8 @@ key_lookup_sa(
 {
 	struct secashead *sah;
 	struct secasvar *sav;
-	u_int stateidx, state;
-	const u_int *saorder_state_valid;
-	int arraysize, chkport;
+	u_int state;
+	int chkport;
 	int s;
 
 	int must_check_spi = 1;
@@ -1245,18 +1250,10 @@ key_lookup_sa(
 	 * IPsec tunnel packet is received.  But ESP tunnel mode is
 	 * encrypted so we can't check internal IP header.
 	 */
-	if (key_prefered_oldsa) {
-		saorder_state_valid = saorder_state_valid_prefer_old;
-		arraysize = _ARRAYLEN(saorder_state_valid_prefer_old);
-	} else {
-		saorder_state_valid = saorder_state_valid_prefer_new;
-		arraysize = _ARRAYLEN(saorder_state_valid_prefer_new);
-	}
 	s = pserialize_read_enter();
 	SAHLIST_READER_FOREACH(sah) {
 		/* search valid state */
-		for (stateidx = 0; stateidx < arraysize; stateidx++) {
-			state = saorder_state_valid[stateidx];
+		SASTATE_USABLE_FOREACH(state) {
 			SAVLIST_READER_FOREACH(sav, sah, state) {
 KEYDEBUG_PRINTF(KEYDEBUG_MATCH,
 "try match spi %#x, %#x\n",



CVS commit: [netbsd-8] src/sys/dev/isa

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:28:24 UTC 2018

Modified Files:
src/sys/dev/isa [netbsd-8]: wbsio.c

Log Message:
Pull up following revision(s) (requested by yamaguchi in ticket #765):

sys/dev/isa/wbsio.c: revision 1.22

Handle watchdog attachment in the wbsio_rescan() function, where we
take care of other children.

ok knakahara@ and yamaguchi@


To generate a diff of this commit:
cvs rdiff -u -r1.10.10.2 -r1.10.10.3 src/sys/dev/isa/wbsio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/wbsio.c
diff -u src/sys/dev/isa/wbsio.c:1.10.10.2 src/sys/dev/isa/wbsio.c:1.10.10.3
--- src/sys/dev/isa/wbsio.c:1.10.10.2	Mon Feb 19 18:50:35 2018
+++ src/sys/dev/isa/wbsio.c	Mon Apr 16 14:28:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: wbsio.c,v 1.10.10.2 2018/02/19 18:50:35 snj Exp $	*/
+/*	$NetBSD: wbsio.c,v 1.10.10.3 2018/04/16 14:28:23 martin Exp $	*/
 /*	$OpenBSD: wbsio.c,v 1.10 2015/03/14 03:38:47 jsg Exp $	*/
 /*
  * Copyright (c) 2008 Mark Kettenis 
@@ -284,8 +284,7 @@ wbsio_attach(device_t parent, device_t s
 	if (!pmf_device_register(self, wbsio_suspend, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
 
-	wbsio_wdog_attach(self);
-
+	sc->sc_smw_valid = false;
 	wbsio_rescan(self, "wbsio", NULL);
 
 #if NGPIO > 0
@@ -336,6 +335,8 @@ wbsio_rescan(device_t self, const char *
 #endif
 	config_search_loc(wbsio_search, self, ifattr, locators, NULL);
 
+	wbsio_wdog_attach(self);
+
 	return 0;
 }
 
@@ -799,7 +800,8 @@ wbsio_wdog_attach(device_t self)
 	uint16_t devid;
 	uint8_t rev;
 
-	sc->sc_smw_valid = false;
+	if (sc->sc_smw_valid)
+		return;		/* watchdog already attached */
 
 	wbsio_conf_enable(&sc->sc_conf_lock, sc->sc_iot, sc->sc_ioh);
 	devid = wbsio_conf_read(sc->sc_iot, sc->sc_ioh, WBSIO_ID);



CVS commit: [netbsd-8] src

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:25:49 UTC 2018

Modified Files:
src/share/man/man4 [netbsd-8]: wm.4
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h if_wmvar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #764):

sys/dev/pci/if_wm.c: revision 1.567
sys/dev/pci/if_wm.c: revision 1.568
sys/dev/pci/if_wm.c: revision 1.569
sys/dev/pci/if_wmvar.h: revision 1.38
sys/dev/pci/if_wm.c: revision 1.570
sys/dev/pci/if_wm.c: revision 1.571
sys/dev/pci/if_wm.c: revision 1.572
share/man/man4/wm.4: revision 1.40
sys/dev/pci/if_wmreg.h: revision 1.106
sys/dev/pci/if_wmreg.h: revision 1.107

SW PHY Config Enable bit for ICH8 B0 stepping is not bit 1 but bit 0.

 No binary change:
- Sort registers.
- Lowercase hexadecimal value.

 On PCH_SPT (and newer), FLASH access should be done by 32bit.
Especially for ICH_FLASH_HSFCTL register, it's located at 0x0006, so
it should be accessed via ICH_FLASH_HSFSTS(0x0004) and use shift or mask.

 Our PCH_SPT part of wm_nvm_valid_bank_detect_ich8lan() was based on
FreeBSD r287467. After that, they reverted it and committed the different
code in r287762. r287762's bank detect code didn't work for us because our wm
dirver had a problem in flash access. The problem was fixed in if_wm.c rev.
1.567, so we can use the new way now.

 If the extended configration size in the EXTCNFSIZE register is 0, don't
continue.
 Add PCH_CNP support (I219 with Intel 300 series chipset).
It's required more test, so it's disabled by default.

 Enable I219.

 I354 uses an external PHY, so don't use wm_set_eee_i350().


To generate a diff of this commit:
cvs rdiff -u -r1.36.4.1 -r1.36.4.2 src/share/man/man4/wm.4
cvs rdiff -u -r1.508.4.16 -r1.508.4.17 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.3 -r1.98.6.4 src/sys/dev/pci/if_wmreg.h
cvs rdiff -u -r1.33.6.1 -r1.33.6.2 src/sys/dev/pci/if_wmvar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/wm.4
diff -u src/share/man/man4/wm.4:1.36.4.1 src/share/man/man4/wm.4:1.36.4.2
--- src/share/man/man4/wm.4:1.36.4.1	Mon Feb  5 15:07:30 2018
+++ src/share/man/man4/wm.4	Mon Apr 16 14:25:49 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wm.4,v 1.36.4.1 2018/02/05 15:07:30 martin Exp $
+.\"	$NetBSD: wm.4,v 1.36.4.2 2018/04/16 14:25:49 martin Exp $
 .\"
 .\" Copyright 2002, 2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 18, 2018
+.Dd April 13, 2018
 .Dt WM 4
 .Os
 .Sh NAME
@@ -152,6 +152,8 @@ Intel I210 Ethernet (Copper, Fiber)
 Intel I211 Ethernet
 .It
 Intel I217 and I218 Ethernet
+.It
+Intel I219 Ethernet (with Intel [123]00 series chipset)
 .El
 .Pp
 In addition to Intel's own

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.16 src/sys/dev/pci/if_wm.c:1.508.4.17
--- src/sys/dev/pci/if_wm.c:1.508.4.16	Tue Mar  6 10:59:04 2018
+++ src/sys/dev/pci/if_wm.c	Mon Apr 16 14:25:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.16 2018/03/06 10:59:04 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.17 2018/04/16 14:25:49 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.16 2018/03/06 10:59:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.17 2018/04/16 14:25:49 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1485,7 +1485,6 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I218_LM3,
 	  "I218 LM Ethernet Connection",
 	  WM_T_PCH_LPT,		WMP_F_COPPER },
-#if 0
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V,
 	  "I219 V Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
@@ -1513,7 +1512,18 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM5,
 	  "I219 LM Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
-#endif
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V6,
+	  "I219 V Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V7,
+	  "I219 V Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM6,
+	  "I219 LM Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
+	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM7,
+	  "I219 LM Ethernet Connection",
+	  WM_T_PCH_CNP,		WMP_F_COPPER },
 	{ 0,			0,
 	  NULL,
 	  0,			0 },
@@ -1986,7 +1996,8 @@ alloc_retry:
 		&& (sc->sc_type != WM_T_PCH)
 		&& (sc->sc_type != WM_T_PCH2)
 		&& (sc->sc_type != WM_T_PCH_LPT)
-		&& (sc->sc_type != WM_T_PCH_SPT)) {
+		&& (sc->sc_type != WM_T_PCH_SPT)
+		&& (sc->sc_type != WM_T_PCH_CNP)) {
 			/* ICH* and PCH* have no PCIe capability regi

CVS commit: [netbsd-8] src/sys/dev/pci

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:21:48 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: ichsmb.c pucdata.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #763):

sys/dev/pci/ichsmb.c: revision 1.57
sys/dev/pci/pucdata.c: revision 1.101

Add 300 series chipset support.


To generate a diff of this commit:
cvs rdiff -u -r1.50.6.1 -r1.50.6.2 src/sys/dev/pci/ichsmb.c
cvs rdiff -u -r1.99.8.1 -r1.99.8.2 src/sys/dev/pci/pucdata.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.50.6.1 src/sys/dev/pci/ichsmb.c:1.50.6.2
--- src/sys/dev/pci/ichsmb.c:1.50.6.1	Mon Feb 26 00:05:04 2018
+++ src/sys/dev/pci/ichsmb.c	Mon Apr 16 14:21:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.50.6.1 2018/02/26 00:05:04 snj Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.50.6.2 2018/04/16 14:21:48 martin Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.50.6.1 2018/02/26 00:05:04 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.50.6.2 2018/04/16 14:21:48 martin Exp $");
 
 #include 
 #include 
@@ -117,6 +117,7 @@ ichsmb_match(device_t parent, cfdata_t m
 		case PCI_PRODUCT_INTEL_100SERIES_SMB:
 		case PCI_PRODUCT_INTEL_100SERIES_LP_SMB:
 		case PCI_PRODUCT_INTEL_2HS_SMB:
+		case PCI_PRODUCT_INTEL_3HS_SMB:
 		case PCI_PRODUCT_INTEL_CORE4G_M_SMB:
 		case PCI_PRODUCT_INTEL_CORE5G_M_SMB:
 		case PCI_PRODUCT_INTEL_BAYTRAIL_PCU_SMB:

Index: src/sys/dev/pci/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.99.8.1 src/sys/dev/pci/pucdata.c:1.99.8.2
--- src/sys/dev/pci/pucdata.c:1.99.8.1	Sat Jan 13 05:36:03 2018
+++ src/sys/dev/pci/pucdata.c	Mon Apr 16 14:21:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.99.8.1 2018/01/13 05:36:03 snj Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.99.8.2 2018/04/16 14:21:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.99.8.1 2018/01/13 05:36:03 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.99.8.2 2018/04/16 14:21:48 martin Exp $");
 
 #include 
 #include 
@@ -1936,7 +1936,16 @@ const struct puc_device_description puc_
 		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
 	},
 	},
-	
+
+	/* Intel 300 Series KT */
+	{   "Intel 300 Series KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3HS_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
 	/* Intel C600/X79 Series KT */
 	{   "Intel C600/X79 Series KT",
 	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C600_KT, 0, 0 },



CVS commit: [netbsd-8] src/sys/arch/x86/pci

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:18:53 UTC 2018

Modified Files:
src/sys/arch/x86/pci [netbsd-8]: if_vmx.c

Log Message:
Pull up following revision(s) (requested by nonaka in ticket #762):

sys/arch/x86/pci/if_vmx.c: revision 1.22

vmx(4): Fix calculation of interface statistics counter.


To generate a diff of this commit:
cvs rdiff -u -r1.19.6.2 -r1.19.6.3 src/sys/arch/x86/pci/if_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.19.6.2 src/sys/arch/x86/pci/if_vmx.c:1.19.6.3
--- src/sys/arch/x86/pci/if_vmx.c:1.19.6.2	Mon Feb 26 01:01:41 2018
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Apr 16 14:18:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.19.6.2 2018/02/26 01:01:41 snj Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.19.6.3 2018/04/16 14:18:53 martin Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.2 2018/02/26 01:01:41 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.19.6.3 2018/04/16 14:18:53 martin Exp $");
 
 #include 
 #include 
@@ -2892,20 +2892,26 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
 		splx(s);
 		break;
 	case SIOCGIFDATA:
+		ifp->if_ipackets = 0;
+		ifp->if_iqdrops = 0;
+		ifp->if_ierrors = 0;
 		for (int i = 0; i < sc->vmx_nrxqueues; i++) {
-			ifp->if_ipackets =
+			ifp->if_ipackets +=
 			sc->vmx_rxq[i].vxrxq_stats.vmrxs_ipackets;
-			ifp->if_iqdrops =
+			ifp->if_iqdrops +=
 			sc->vmx_rxq[i].vxrxq_stats.vmrxs_iqdrops;
-			ifp->if_ierrors =
+			ifp->if_ierrors +=
 			sc->vmx_rxq[i].vxrxq_stats.vmrxs_ierrors;
 		}
+		ifp->if_opackets = 0;
+		ifp->if_obytes = 0;
+		ifp->if_omcasts = 0;
 		for (int i = 0; i < sc->vmx_ntxqueues; i++) {
-			ifp->if_opackets =
+			ifp->if_opackets +=
 			sc->vmx_txq[i].vxtxq_stats.vmtxs_opackets;
-			ifp->if_obytes =
+			ifp->if_obytes +=
 			sc->vmx_txq[i].vxtxq_stats.vmtxs_obytes;
-			ifp->if_omcasts =
+			ifp->if_omcasts +=
 			sc->vmx_txq[i].vxtxq_stats.vmtxs_omcasts;
 		}
 		/* FALLTHROUGH */



CVS commit: src/sys/kern

2018-04-16 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Mon Apr 16 14:18:16 UTC 2018

Modified Files:
src/sys/kern: init_main.c

Log Message:
Set initproc inside start_init()

This allows us to stop using the rnewprocp argument in fork1(9).

The rnewprocp argument will be removed soon from the API, as it can cause
use-after-free scenarios.

No functional change intended.

Noted by 
Reference: http://mail-index.netbsd.org/tech-kern/2017/09/08/msg022267.html

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.495 -r1.496 src/sys/kern/init_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/init_main.c
diff -u src/sys/kern/init_main.c:1.495 src/sys/kern/init_main.c:1.496
--- src/sys/kern/init_main.c:1.495	Sun Feb  4 17:31:51 2018
+++ src/sys/kern/init_main.c	Mon Apr 16 14:18:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_main.c,v 1.495 2018/02/04 17:31:51 maxv Exp $	*/
+/*	$NetBSD: init_main.c,v 1.496 2018/04/16 14:18:16 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.495 2018/02/04 17:31:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.496 2018/04/16 14:18:16 kamil Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -608,7 +608,7 @@ main(void)
 	 * wait for us to inform it that the root file system has been
 	 * mounted.
 	 */
-	if (fork1(l, 0, SIGCHLD, NULL, 0, start_init, NULL, NULL, &initproc))
+	if (fork1(l, 0, SIGCHLD, NULL, 0, start_init, NULL, NULL, NULL))
 		panic("fork init");
 
 	/*
@@ -930,6 +930,8 @@ start_init(void *arg)
 	char ipath[129];
 	int ipx, len;
 
+	initproc = p;
+
 	/*
 	 * Now in process 1.
 	 */



CVS commit: [netbsd-8] src/sys/dev/isa

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:16:53 UTC 2018

Modified Files:
src/sys/dev/isa [netbsd-8]: sbdsp.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #761):

sys/dev/isa/sbdsp.c: revision 1.137

Add AUDIO_ENCODING_SLINEAR to supported encodings.  This allows sb, sbpro
& sb16 to configure with 8-bit precision.

Tested in games/mame with a 486DX emulation.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.136.10.1 src/sys/dev/isa/sbdsp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/sbdsp.c
diff -u src/sys/dev/isa/sbdsp.c:1.136 src/sys/dev/isa/sbdsp.c:1.136.10.1
--- src/sys/dev/isa/sbdsp.c:1.136	Mon Jul 11 11:31:50 2016
+++ src/sys/dev/isa/sbdsp.c	Mon Apr 16 14:16:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbdsp.c,v 1.136 2016/07/11 11:31:50 msaitoh Exp $	*/
+/*	$NetBSD: sbdsp.c,v 1.136.10.1 2018/04/16 14:16:53 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2008 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.136 2016/07/11 11:31:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbdsp.c,v 1.136.10.1 2018/04/16 14:16:53 martin Exp $");
 
 #include "midi.h"
 #include "mpu.h"
@@ -640,6 +640,7 @@ sbdsp_set_params(
 	swcode = swap_bytes;
 }
 /* fall into */
+			case AUDIO_ENCODING_SLINEAR:
 			case AUDIO_ENCODING_SLINEAR_LE:
 bmode = SB_BMODE_SIGNED;
 break;
@@ -682,6 +683,7 @@ sbdsp_set_params(
 bmode |= SB_BMODE_STEREO;
 		} else if (m->model == SB_JAZZ && m->precision == 16) {
 			switch (p->encoding) {
+			case AUDIO_ENCODING_SLINEAR:
 			case AUDIO_ENCODING_SLINEAR_LE:
 break;
 			case AUDIO_ENCODING_ULINEAR_LE:
@@ -716,6 +718,7 @@ sbdsp_set_params(
 			switch (p->encoding) {
 			case AUDIO_ENCODING_SLINEAR_BE:
 			case AUDIO_ENCODING_SLINEAR_LE:
+			case AUDIO_ENCODING_SLINEAR:
 hw.encoding = AUDIO_ENCODING_ULINEAR_LE;
 swcode = change_sign8;
 break;



CVS commit: [netbsd-8] src/sys/dev/isa

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:15:03 UTC 2018

Modified Files:
src/sys/dev/isa [netbsd-8]: gus.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #760):

sys/dev/isa/gus.c: revision 1.112

Add padding to gus.c so fields match up when it ts cast to a ad1848_isa
softc for the allocation of hw ring buffers.

Locking fixes as gus KASSERTS / uses the codec locks.

Ok christos@.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.111.6.1 src/sys/dev/isa/gus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/isa/gus.c
diff -u src/sys/dev/isa/gus.c:1.111 src/sys/dev/isa/gus.c:1.111.6.1
--- src/sys/dev/isa/gus.c:1.111	Wed Feb  1 19:10:33 2017
+++ src/sys/dev/isa/gus.c	Mon Apr 16 14:15:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gus.c,v 1.111 2017/02/01 19:10:33 jakllsch Exp $	*/
+/*	$NetBSD: gus.c,v 1.111.6.1 2018/04/16 14:15:03 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1999, 2008 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.111 2017/02/01 19:10:33 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.111.6.1 2018/04/16 14:15:03 martin Exp $");
 
 #include 
 #include 
@@ -175,15 +175,16 @@ struct gus_softc {
 	kmutex_t sc_intr_lock;
 	void *sc_ih;			/* interrupt vector */
 	bus_space_tag_t sc_iot;		/* tag */
-	isa_chipset_tag_t sc_ic;	/* ISA chipset info */
 	bus_space_handle_t sc_ioh1;	/* handle */
 	bus_space_handle_t sc_ioh2;	/* handle */
 	bus_space_handle_t sc_ioh3;	/* ICS2101 handle */
 	bus_space_handle_t sc_ioh4;	/* MIDI handle */
+	char padding[20];
 
 	callout_t sc_dmaout_ch;
 
-	int sc_iobase;			/* I/O base address */
+	isa_chipset_tag_t sc_ic;	/* ISA chipset info */
+	char padding1[4];
 	int sc_irq;			/* IRQ used */
 	int sc_playdrq;			/* DMA channel for play */
 	bus_size_t sc_play_maxsize;	/* DMA size for play */
@@ -257,6 +258,7 @@ struct gus_softc {
 		struct ics2101_softc sc_mixer_u;
 		struct ad1848_isa_softc sc_codec_u;
 	} u;
+	int sc_iobase;			/* I/O base address */
 #define sc_mixer u.sc_mixer_u
 #define sc_codec u.sc_codec_u
 };
@@ -818,9 +820,12 @@ gusattach(device_t parent, device_t self
 	const struct audio_hw_if *hwif;
 
 	sc = device_private(self);
+	sc->sc_dev = self;
 	ia = aux;
 	callout_init(&sc->sc_dmaout_ch, CALLOUT_MPSAFE);
 	ad1848_init_locks(&sc->sc_codec.sc_ad1848, IPL_AUDIO);
+	sc->sc_lock = sc->sc_codec.sc_ad1848.sc_lock;
+	sc->sc_intr_lock = sc->sc_codec.sc_ad1848.sc_intr_lock;
 
 	sc->sc_iot = iot = ia->ia_iot;
 	sc->sc_ic = ia->ia_ic;
@@ -859,7 +864,7 @@ gusattach(device_t parent, device_t self
 
 	delay(500);
 
-	mutex_spin_enter(&sc->sc_intr_lock);
+	mutex_spin_enter(&sc->sc_codec.sc_ad1848.sc_intr_lock);
 
 	c = bus_space_read_1(iot, ioh3, GUS_BOARD_REV);
 	if (c != 0xff)
@@ -872,7 +877,7 @@ gusattach(device_t parent, device_t self
 
 	gusreset(sc, GUS_MAX_VOICES); /* initialize all voices */
 	gusreset(sc, GUS_MIN_VOICES); /* then set to just the ones we use */
-	mutex_spin_exit(&sc->sc_intr_lock);
+	mutex_spin_exit(&sc->sc_codec.sc_ad1848.sc_intr_lock);
 
 	/*
 	 * Setup the IRQ and DRQ lines in software, using values from
@@ -2311,7 +2316,7 @@ gus_set_params(void *addr,int setmode, i
 		return EINVAL;
 	}
 
-	mutex_spin_enter(&sc->sc_intr_lock);
+	mutex_spin_enter(&sc->sc_codec.sc_ad1848.sc_intr_lock);
 
 	if (p->precision == 8) {
 		sc->sc_voc[GUS_VOICE_LEFT].voccntl &= ~GUSMASK_DATA_SIZE16;
@@ -2332,7 +2337,7 @@ gus_set_params(void *addr,int setmode, i
 	if (setmode & AUMODE_PLAY)
 		sc->sc_orate = p->sample_rate;
 
-	mutex_spin_exit(&sc->sc_intr_lock);
+	mutex_spin_exit(&sc->sc_codec.sc_ad1848.sc_intr_lock);
 
 	hw = *p;
 	/* clear req_size before setting a filter to avoid confliction



CVS commit: [netbsd-8] src/sys/dev

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 14:11:44 UTC 2018

Modified Files:
src/sys/dev [netbsd-8]: auconv.c audio.c audiovar.h aurateconv.c

Log Message:
Pull up following revision(s) (requested by nat in ticket #759):

sys/dev/audio.c: revision 1.367
sys/dev/audio.c: revision 1.369
sys/dev/audio.c: revision 1.376 (patch)
sys/dev/audio.c: revision 1.377 (patch)
sys/dev/audio.c: revision 1.378
sys/dev/audio.c: revision 1.382 (patch)
sys/dev/audio.c: revision 1.383 (patch)
sys/dev/audio.c: revision 1.384
sys/dev/audio.c: revision 1.388
sys/dev/audio.c: revision 1.389
sys/dev/audio.c: revision 1.395
sys/dev/audio.c: revision 1.396 (patch)
sys/dev/audio.c: revision 1.397
sys/dev/audio.c: revision 1.403
sys/dev/audio.c: revision 1.451
sys/dev/audio.c: revision 1.452
sys/dev/audiovar.h: revision 1.59 (patch)
sys/dev/aurateconv.c: revision 1.21 (patch)
sys/dev/auconv.c: revision 1.31 (patch)
sys/dev/audiovar.h: revision 1.60 (patch)

Broadcast all conditional variables if in being deactivated so no readers
or writers get stuck.

Fix a panic caused by opening pad(4)'s mixer before the corresponding
audio device has attached.

Addresses PR kern/52424.

Improve audio_set_vchan_defaults().
- Correct confused input/output parameters.
- Remove sc->{sc_channels, sc_precision, sc_frequency}.  They are
  the same as sc->sc_vchan_params.{channels, precision, sample_rate}.
The input parameter of audio_set_vchan_defaults() is now only
sc->sc_vchan_params.

Fix PR kern/52437

const-ify.

0 -> NULL in audioattach()

"bits" sounds better than "name" for argument name.
I feel expression (name / NBBY) a little strange.

The audio module will now compile with WARNS=5.

Typo in debug message.

Remove a duplicated line.

Add missing initialization of sc_rfilters in audioattach().

Remove dead codes.

sc->sc_opens never changes in this loop and as a result of
previous sc_audiochan cleanup "sc_opens == 0" is the same as
"sc_audiochan is empty".

Clean up audio_allocbufs().

As a result of sc_audiochan cleanup, it is easy to access sc_hwvc.

Clean up audio_open().

As a result of sc_audiochan cleanup, this loop is the same as last + 1.
hw_if->set_params is mandatory, so it will never be NULL.

CID-1427745: kill possible buffer overflows.

Revert my wrong r1.380 and add a comment instead.


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.4 -r1.26.2.5 src/sys/dev/auconv.c
cvs rdiff -u -r1.357.2.10 -r1.357.2.11 src/sys/dev/audio.c
cvs rdiff -u -r1.55.2.5 -r1.55.2.6 src/sys/dev/audiovar.h
cvs rdiff -u -r1.19.42.1 -r1.19.42.2 src/sys/dev/aurateconv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/auconv.c
diff -u src/sys/dev/auconv.c:1.26.2.4 src/sys/dev/auconv.c:1.26.2.5
--- src/sys/dev/auconv.c:1.26.2.4	Tue Jan  9 19:35:03 2018
+++ src/sys/dev/auconv.c	Mon Apr 16 14:11:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: auconv.c,v 1.26.2.4 2018/01/09 19:35:03 snj Exp $	*/
+/*	$NetBSD: auconv.c,v 1.26.2.5 2018/04/16 14:11:44 martin Exp $	*/
 
 /*
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.4 2018/01/09 19:35:03 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.26.2.5 2018/04/16 14:11:44 martin Exp $");
 
 #include 
 #include 
@@ -2115,7 +2115,7 @@ auconv_rateconv_check_rates(const struct
 			if (formats[i].frequency[1] > maxrate)
 maxrate = formats[i].frequency[1];
 		} else {
-			for (j = 0; j < formats[i].frequency_type; j++) {
+			for (j = 0; j < (int)formats[i].frequency_type; j++) {
 if (formats[i].frequency[j] < minrate)
 	minrate = formats[i].frequency[j];
 if (formats[i].frequency[j] > maxrate)

Index: src/sys/dev/audio.c
diff -u src/sys/dev/audio.c:1.357.2.10 src/sys/dev/audio.c:1.357.2.11
--- src/sys/dev/audio.c:1.357.2.10	Mon Jan 15 00:08:55 2018
+++ src/sys/dev/audio.c	Mon Apr 16 14:11:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.357.2.10 2018/01/15 00:08:55 snj Exp $	*/
+/*	$NetBSD: audio.c,v 1.357.2.11 2018/04/16 14:11:44 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Nathanial Sloss 
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.10 2018/01/15 00:08:55 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.357.2.11 2018/04/16 14:11:44 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -209,7 +209,7 @@ int	audiodebug = AUDIO_DEBUG;
 
 #define PREFILL_BLOCKS	3	/* no. audioblocks required to start stream */
 #define ROUNDSIZE(x)	(x) &= -16	/* round to nice boundary */
-#define SPECIFIED(x)	((x) != ~0)
+#define SPECIFIED(x)	((int)(x) != ~0)
 #define SPECIFIED_CH(x)	((x) != (u_char)~0)
 
 /* #define AUDIO_PM_IDLE */
@@ -282,10 +282,10 @@ static void	audio_calc_latency(struct au
 stat

CVS commit: [netbsd-8] src/sys/kern

2018-04-16 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Apr 16 13:31:33 UTC 2018

Modified Files:
src/sys/kern [netbsd-8]: kern_proc.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #758):

sys/kern/kern_proc.c: revision 1.212

Don't set errno ESRCH for empty result of KINFO_PROC[2]

Restore the previous behavior as it's prefered.
This new behavior was introduced in 1.210.
Code should check for length of the result.

Requested by 


To generate a diff of this commit:
cvs rdiff -u -r1.206.6.3 -r1.206.6.4 src/sys/kern/kern_proc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_proc.c
diff -u src/sys/kern/kern_proc.c:1.206.6.3 src/sys/kern/kern_proc.c:1.206.6.4
--- src/sys/kern/kern_proc.c:1.206.6.3	Thu Apr 12 13:42:48 2018
+++ src/sys/kern/kern_proc.c	Mon Apr 16 13:31:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_proc.c,v 1.206.6.3 2018/04/12 13:42:48 martin Exp $	*/
+/*	$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.3 2018/04/12 13:42:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.206.6.4 2018/04/16 13:31:33 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kstack.h"
@@ -1834,10 +1834,6 @@ sysctl_doeproc(SYSCTLFN_ARGS)
 	mutex_exit(proc_lock);
 
 	if (where != NULL) {
-		if (needed == 0) {
-			error = ESRCH;
-			goto out;
-		}
 		*oldlenp = dp - where;
 		if (needed > *oldlenp) {
 			error = ENOMEM;



CVS commit: src/sys/dev/pci

2018-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 16 13:11:53 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
 Add Intel SSD 760p.


To generate a diff of this commit:
cvs rdiff -u -r1.1328 -r1.1329 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1328 src/sys/dev/pci/pcidevs:1.1329
--- src/sys/dev/pci/pcidevs:1.1328	Mon Apr 16 13:08:33 2018
+++ src/sys/dev/pci/pcidevs	Mon Apr 16 13:11:53 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1328 2018/04/16 13:08:33 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1329 2018/04/16 13:11:53 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -5291,6 +5291,7 @@ product INTEL CP_SS_REGS	0xd156	Core Pro
 product INTEL CP_SCS_REGS	0xd157	Core Processor System Control and Status Registers
 product INTEL CP_MISC_REGS	0xd158	Core Processor Miscellaneous Registers
 product INTEL HANKSVILLE	0xf0fe	HANKSVILLE LAN Controller
+product INTEL SSD_760P		0xf1a6	SSD 760p
 
 /* Intergraph products */
 product INTERGRAPH 4D60T	0x00e3	Powerstorm 4D60T



CVS commit: src/sys/dev/pci

2018-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 16 13:08:33 UTC 2018

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
 Add some 8th Generation Intel Core Processor devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1327 -r1.1328 src/sys/dev/pci/pcidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1327 src/sys/dev/pci/pcidevs:1.1328
--- src/sys/dev/pci/pcidevs:1.1327	Mon Apr  9 15:33:54 2018
+++ src/sys/dev/pci/pcidevs	Mon Apr 16 13:08:33 2018
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1327 2018/04/09 15:33:54 msaitoh Exp $
+$NetBSD: pcidevs,v 1.1328 2018/04/16 13:08:33 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -4469,6 +4469,11 @@ product INTEL E5_UNICAST	0x3ce8	E5 Unica
 product INTEL E5_SAD_1		0x3cf4	E5 SAD
 product INTEL E5_BROADCAST	0x3cf5	E5 Broadcast
 product INTEL E5_SAD_2		0x3cf6	E5 SAD
+product INTEL CORE8G_S_HOST_DRAM_4C 0x3e1f Core 8G (S) Host Bridge, DRAM
+product INTEL CORE8G_S_HOST_DRAM_6C 0x3ec2 Core 8G (S) Host Bridge, DRAM
+product INTEL CORE8G_PCIE_X16	0x3e81 Core 8G (S) PCIe x16
+product INTEL CORE8G_PCIE_X8	0x3e85 Core 8G (S) PCIe x16
+product INTEL CORE8G_PCIE_X4	0x3e89 Core 8G (S) PCIe x16
 product INTEL COFLK_IGD_1	0x3e90	UHD Graphics 610
 product INTEL COFLK_IGD_2	0x3e91	UHD Graphics 630
 product INTEL COFLK_IGD_3	0x3e92	UHD Graphics 630



CVS commit: src/distrib/sets/lists

2018-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr 16 12:25:18 UTC 2018

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/comp: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
fix the sets for binutils-2.30


To generate a diff of this commit:
cvs rdiff -u -r1.834 -r1.835 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.313 -r1.314 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.195 -r1.196 src/distrib/sets/lists/debug/shl.mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.834 src/distrib/sets/lists/base/shl.mi:1.835
--- src/distrib/sets/lists/base/shl.mi:1.834	Sun Apr 15 15:47:30 2018
+++ src/distrib/sets/lists/base/shl.mi	Mon Apr 16 08:25:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.834 2018/04/15 19:47:30 christos Exp $
+# $NetBSD: shl.mi,v 1.835 2018/04/16 12:25:18 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -194,10 +194,10 @@
 ./usr/lib/libavl.sobase-zfs-shlib		compatfile,zfs
 ./usr/lib/libavl.so.0base-zfs-shlib		compatfile,zfs
 ./usr/lib/libavl.so.0.0  		base-zfs-shlib		compatfile,zfs
-./usr/lib/libbfd.so.14base-sys-shlib		compatfile,binutils=226
-./usr/lib/libbfd.so.14.0			base-sys-shlib		compatfile,binutils=226
 ./usr/lib/libbfd.so.15base-sys-shlib		compatfile,binutils=227
 ./usr/lib/libbfd.so.15.0			base-sys-shlib		compatfile,binutils=227
+./usr/lib/libbfd.so.16base-sys-shlib		compatfile,binutils=230
+./usr/lib/libbfd.so.16.0			base-sys-shlib		compatfile,binutils=230
 ./usr/lib/libbind9.sobase-bind-shlib		compatfile
 ./usr/lib/libbind9.so.8base-bind-shlib		compatfile
 ./usr/lib/libbind9.so.8.5			base-bind-shlib		compatfile

Index: src/distrib/sets/lists/comp/shl.mi
diff -u src/distrib/sets/lists/comp/shl.mi:1.313 src/distrib/sets/lists/comp/shl.mi:1.314
--- src/distrib/sets/lists/comp/shl.mi:1.313	Tue Feb 13 05:02:12 2018
+++ src/distrib/sets/lists/comp/shl.mi	Mon Apr 16 08:25:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.313 2018/02/13 10:02:12 mrg Exp $
+# $NetBSD: shl.mi,v 1.314 2018/04/16 12:25:18 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -113,10 +113,12 @@
 ./usr/lib/libntp_pic.acomp-obsolete		obsolete
 ./usr/lib/libnvpair_pic.a			comp-zfs-piclib		compatfile,picinstall,zfs
 ./usr/lib/libobjc_pic.acomp-objc-piclib	compatfile,picinstall,gcccmds
-./usr/lib/libopcodes.so.7			comp-c-shlib		compatfile,binutils=226
-./usr/lib/libopcodes.so.7.0			comp-c-shlib		compatfile,binutils=226
 ./usr/lib/libopcodes.so.8			comp-c-shlib		compatfile,binutils=227
 ./usr/lib/libopcodes.so.8.0			comp-c-shlib		compatfile,binutils=227
+./usr/lib/libopcodes.so.9			comp-c-shlib		compatfile,binutils=230
+./usr/lib/libopcodes.so.9.0			comp-c-shlib		compatfile,binutils=230
+./usr/lib/libopenpgpsdk_pic.a			comp-obsolete		obsolete
+./usr/lib/libossaudio_pic.a			comp-c-piclib		compatfile,picinstall
 ./usr/lib/libopenpgpsdk_pic.a			comp-obsolete		obsolete
 ./usr/lib/libossaudio_pic.a			comp-c-piclib		compatfile,picinstall
 ./usr/lib/libp2k_pic.acomp-puffs-piclib	compatfile,picinstall,rump

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.195 src/distrib/sets/lists/debug/shl.mi:1.196
--- src/distrib/sets/lists/debug/shl.mi:1.195	Sun Apr 15 15:47:30 2018
+++ src/distrib/sets/lists/debug/shl.mi	Mon Apr 16 08:25:18 2018
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.195 2018/04/15 19:47:30 christos Exp $
+# $NetBSD: shl.mi,v 1.196 2018/04/16 12:25:18 christos Exp $
 ./usr/lib/libbfd_g.a		comp-c-debuglib	debuglib,compatfile,binutils
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug		comp-sys-debug	debug,dynamicroot
@@ -63,8 +63,8 @@
 ./usr/libdata/debug/usr/lib/libatf-c++.so.2.0.debug		comp-atf-debug	debug,compatfile,atf
 ./usr/libdata/debug/usr/lib/libatf-c.so.0.0.debug		comp-atf-debug	debug,compatfile,atf
 ./usr/libdata/debug/usr/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,compatfile,zfs
-./usr/libdata/debug/usr/lib/libbfd.so.14.0.debug		comp-sys-debug	debug,compatfile,binutils=226
 ./usr/libdata/debug/usr/lib/libbfd.so.15.0.debug		comp-sys-debug	debug,compatfile,binutils=227
+./usr/libdata/debug/usr/lib/libbfd.so.16.0.debug		comp-sys-debug	debug,compatfile,binutils=230
 ./usr/libdata/debug/usr/lib/libbind9.so.8.5.debug		comp-bind-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libblacklist.so.0.0.debug		comp-sys-debug	debug,compatfile
 ./usr/libdata/debug/usr/lib/libbluetooth.so.4.2.debug		comp-sys-debug	debug,compatfile
@@ -148,8 +148,8 @@
 ./usr/libdata/debug/usr/lib/libnpf.so.0.1.debug			comp-npf-debug	debug,compatfile,npf
 ./usr/libdata/debug/usr/lib/libnvpair.so.0.0.debug

CVS commit: [pgoyette-compat] src/doc

2018-04-16 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Mon Apr 16 09:53:02 UTC 2018

Modified Files:
src/doc [pgoyette-compat]: COMPAT-branch-notes

Log Message:
Update with notes from a recent status update e-mail sent to tech-kern


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/COMPAT-branch-notes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/COMPAT-branch-notes
diff -u src/doc/COMPAT-branch-notes:1.1.2.9 src/doc/COMPAT-branch-notes:1.1.2.10
--- src/doc/COMPAT-branch-notes:1.1.2.9	Tue Apr  3 08:29:44 2018
+++ src/doc/COMPAT-branch-notes	Mon Apr 16 09:53:02 2018
@@ -1,60 +1,114 @@
 DONE
 
-1. Removed linking of the kernel compat object library into all kernels;
-   using the .o library caused some build breakage, and resulted in the
-   bulk of the compat code being included in every kernel, but without
-   any module linkage.  In turn, this caused failure when loading some
-   modules due to symbols already being defined in the kernel.
-
-2. Reverted some intentional breakage for loading the sysv_ipc module;
-   the breakage was introduced as the fix for the above-mentioned build
-   breakage.  
-
-3. Split the sysv_ipc compat routines into their own compat_sysv module.
-
-4. Resolved some inter-module dependencies.
-
-5. Extracted some net/if.c compat routines into the compat module, and
-   replaced the originals with indirect (vectored) function calls.
-
-6. Implemented a mechanism for modules to include "aliases", allowing
-   a single module file to declare multiple names.  For example, a
-   single "compat" module could declare compat_80, compat_70, etc, and
-   other modules could depend on specific compat levels rather than on
-   the entirety of compat.
-
-7. Reconfirmed existing compat-module dependencies, and update the
-   defopt/defflag lines in the config files* as needed, to insure that
-   built-in dependencies get resolved.
-
-8. Fixed limits on the number of module depedencies and maximum
-   recursion level have been removed.  Previous code for reporting
-   module status to userland has been versioned and moved to the
-   compat_80 module.
+1.  Removed linking of the kernel compat object library into all kernels;
+using the .o library caused some build breakage, and resulted in the
+bulk of the compat code being included in every kernel, but without
+any module linkage.  In turn, this caused failure when loading some
+modules due to symbols already being defined in the kernel.
+
+2.  Reverted some intentional breakage for loading the sysv_ipc module;
+the breakage was introduced as the fix for the above-mentioned build
+breakage.  
+
+3.  Split the sysv_ipc compat routines into their own compat_sysv module.
+
+4.  Resolved some inter-module dependencies.
+
+5.  Extracted some net/if.c compat routines into the compat module, and
+replaced the originals with indirect (vectored) function calls.
+
+6.  Implemented a mechanism for modules to include "aliases", allowing
+a single module file to declare multiple names.  For example, a
+single "compat" module could declare compat_80, compat_70, etc, and
+other modules could depend on specific compat levels rather than on
+the entirety of compat.
+
+7.  Reconfirmed existing compat-module dependencies, and update the
+defopt/defflag lines in the config files* as needed, to insure that
+built-in dependencies get resolved.
+
+8.  Fixed limits on the number of module depedencies and maximum
+recursion level have been removed.  Previous code for reporting
+module status to userland has been versioned and moved to the
+compat_80 module.
 
 
 TODO
 
-1. Audit the entire code base for any remaining embedded #ifdef's for
-   COMPAT_xx.  When found, move the actual compat code into the compat
-   hierarchy and replace originals with indirect (vectored) calls.
-
-2. Using the alias mechanism, split compat (and perhaps compat_sysv)
-   into multiple version-specific modules.  Note that in addition to
-   updating the module code, this would also require changes to
-   syscalls.master files to change the names of the modules associated
-   with module-provided syscalls.
-
-   Update:  These are being done simultaneously, with compat code being
-   moved directly to a version-specific module.  All of COMPAT_80 and
-   COMPAT_70, most of COMPAT_60, and much of COMPAT_50 are finished.
-   Still need to decide how to handle the COMPAT_BSDPTY stuff.
-
-   COMPAT_40 is also finished, except for some arch/sh3 MD code.  There
-   is also some arch/m68k MD-specific code remaining for COMPAT_50.
-
-3. XXX The compat_60 module still needs some work for XEN systems.
-
-4. Update syscalls.master to point the compat calls at the specific
-   modules rather than the monolithic compat module.  Update the
-   "required" lists of other modules, too.
+1.  Audit t

CVS commit: src/sys/arch/x86/pci

2018-04-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Apr 16 09:12:52 UTC 2018

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
vmx(4): compute if_ibytes using rxq->vxrxq_stats.vmrxs_ibytes.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x86/pci/if_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.23 src/sys/arch/x86/pci/if_vmx.c:1.24
--- src/sys/arch/x86/pci/if_vmx.c:1.23	Mon Apr 16 09:10:42 2018
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Apr 16 09:12:52 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.23 2018/04/16 09:10:42 nonaka Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.24 2018/04/16 09:12:52 nonaka Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.23 2018/04/16 09:10:42 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.24 2018/04/16 09:12:52 nonaka Exp $");
 
 #include 
 #include 
@@ -2894,6 +2894,7 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
 	case SIOCGIFDATA:
 	case SIOCZIFDATA:
 		ifp->if_ipackets = 0;
+		ifp->if_ibytes = 0;
 		ifp->if_iqdrops = 0;
 		ifp->if_ierrors = 0;
 		for (int i = 0; i < sc->vmx_nrxqueues; i++) {
@@ -2901,6 +2902,7 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
 
 			VMXNET3_RXQ_LOCK(rxq);
 			ifp->if_ipackets += rxq->vxrxq_stats.vmrxs_ipackets;
+			ifp->if_ibytes += rxq->vxrxq_stats.vmrxs_ibytes;
 			ifp->if_iqdrops += rxq->vxrxq_stats.vmrxs_iqdrops;
 			ifp->if_ierrors += rxq->vxrxq_stats.vmrxs_ierrors;
 			if (cmd == SIOCZIFDATA) {



CVS commit: src/sys/arch/x86/pci

2018-04-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Mon Apr 16 09:10:42 UTC 2018

Modified Files:
src/sys/arch/x86/pci: if_vmx.c

Log Message:
vmx(4): handled SIOCZIFDATA.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/pci/if_vmx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/if_vmx.c
diff -u src/sys/arch/x86/pci/if_vmx.c:1.22 src/sys/arch/x86/pci/if_vmx.c:1.23
--- src/sys/arch/x86/pci/if_vmx.c:1.22	Mon Apr 16 03:21:43 2018
+++ src/sys/arch/x86/pci/if_vmx.c	Mon Apr 16 09:10:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vmx.c,v 1.22 2018/04/16 03:21:43 nonaka Exp $	*/
+/*	$NetBSD: if_vmx.c,v 1.23 2018/04/16 09:10:42 nonaka Exp $	*/
 /*	$OpenBSD: if_vmx.c,v 1.16 2014/01/22 06:04:17 brad Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.22 2018/04/16 03:21:43 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vmx.c,v 1.23 2018/04/16 09:10:42 nonaka Exp $");
 
 #include 
 #include 
@@ -2892,27 +2892,38 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long 
 		splx(s);
 		break;
 	case SIOCGIFDATA:
+	case SIOCZIFDATA:
 		ifp->if_ipackets = 0;
 		ifp->if_iqdrops = 0;
 		ifp->if_ierrors = 0;
 		for (int i = 0; i < sc->vmx_nrxqueues; i++) {
-			ifp->if_ipackets +=
-			sc->vmx_rxq[i].vxrxq_stats.vmrxs_ipackets;
-			ifp->if_iqdrops +=
-			sc->vmx_rxq[i].vxrxq_stats.vmrxs_iqdrops;
-			ifp->if_ierrors +=
-			sc->vmx_rxq[i].vxrxq_stats.vmrxs_ierrors;
+			struct vmxnet3_rxqueue *rxq = &sc->vmx_rxq[i];
+
+			VMXNET3_RXQ_LOCK(rxq);
+			ifp->if_ipackets += rxq->vxrxq_stats.vmrxs_ipackets;
+			ifp->if_iqdrops += rxq->vxrxq_stats.vmrxs_iqdrops;
+			ifp->if_ierrors += rxq->vxrxq_stats.vmrxs_ierrors;
+			if (cmd == SIOCZIFDATA) {
+memset(&rxq->vxrxq_stats, 0,
+sizeof(rxq->vxrxq_stats));
+			}
+			VMXNET3_RXQ_UNLOCK(rxq);
 		}
 		ifp->if_opackets = 0;
 		ifp->if_obytes = 0;
 		ifp->if_omcasts = 0;
 		for (int i = 0; i < sc->vmx_ntxqueues; i++) {
-			ifp->if_opackets +=
-			sc->vmx_txq[i].vxtxq_stats.vmtxs_opackets;
-			ifp->if_obytes +=
-			sc->vmx_txq[i].vxtxq_stats.vmtxs_obytes;
-			ifp->if_omcasts +=
-			sc->vmx_txq[i].vxtxq_stats.vmtxs_omcasts;
+			struct vmxnet3_txqueue *txq = &sc->vmx_txq[i];
+
+			VMXNET3_TXQ_LOCK(txq);
+			ifp->if_opackets += txq->vxtxq_stats.vmtxs_opackets;
+			ifp->if_obytes += txq->vxtxq_stats.vmtxs_obytes;
+			ifp->if_omcasts += txq->vxtxq_stats.vmtxs_omcasts;
+			if (cmd == SIOCZIFDATA) {
+memset(&txq->vxtxq_stats, 0,
+sizeof(txq->vxtxq_stats));
+			}
+			VMXNET3_TXQ_UNLOCK(txq);
 		}
 		/* FALLTHROUGH */
 	default:



CVS commit: src/sys/netipsec

2018-04-16 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Mon Apr 16 08:56:08 UTC 2018

Modified Files:
src/sys/netipsec: key.c keydb.h

Log Message:
Added a lookup table to find an sav quickly

key_sad.sahlists doesn't work well for inbound packets because
its key includes source address. For the reason, the
look-up-table for the inbound packets is newly added.
The table has all sav whose state is MATURE or DYING and uses a
key calculated by destination address, protocol, and spi instead
of saidx.

reviewd ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.251 -r1.252 src/sys/netipsec/key.c
cvs rdiff -u -r1.21 -r1.22 src/sys/netipsec/keydb.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.251 src/sys/netipsec/key.c:1.252
--- src/sys/netipsec/key.c:1.251	Mon Apr 16 08:52:09 2018
+++ src/sys/netipsec/key.c	Mon Apr 16 08:56:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.251 2018/04/16 08:52:09 yamaguchi Exp $	*/
+/*	$NetBSD: key.c,v 1.252 2018/04/16 08:56:08 yamaguchi Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.251 2018/04/16 08:52:09 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.252 2018/04/16 08:56:08 yamaguchi Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -124,6 +124,10 @@ __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.25
 #define SAHHASH_NHASH		128
 #endif
 
+#ifndef SAVLUT_NHASH
+#define SAVLUT_NHASH		128
+#endif
+
 percpu_t *pfkeystat_percpu;
 
 /*
@@ -213,10 +217,13 @@ static u_int32_t acq_seq = 0;
  *   - Multiple saves with the same saidx can exist
  * - Only one entry has MATURE state and others should be DEAD
  * - DEAD entries are just ignored from searching
- * - Modifications to the key_sad.sahlists and sah.savlist must be done with
- *   holding key_sad.lock which is a adaptive mutex
- * - Read accesses to the key_sad.sahlists and sah.savlist must be in
- *   pserialize(9) read sections
+ *   - All sav whose state is MATURE or DYING are registered to the lookup
+ * table called key_sad.savlut in addition to the savlists.
+ * - The table is used to search an sav without use of saidx.
+ * - Modifications to the key_sad.sahlists, sah.savlist and key_sad.savlut
+ *   must be done with holding key_sad.lock which is a adaptive mutex
+ * - Read accesses to the key_sad.sahlists, sah.savlist and key_sad.savlut
+ *   must be in pserialize(9) read sections
  * - sah's lifetime is managed by localcount(9)
  * - Getting an sah entry
  *   - We get an sah from the key_sad.sahlists
@@ -265,6 +272,8 @@ static struct {
 	kcondvar_t cv_lc;
 	struct pslist_head *sahlists;
 	u_long sahlistmask;
+	struct pslist_head *savlut;
+	u_long savlutmask;
 
 	pserialize_t psz;
 	kcondvar_t cv_psz;
@@ -408,6 +417,21 @@ static struct {
 #define SAVLIST_READER_NEXT(sav)	\
 	PSLIST_READER_NEXT((sav), struct secasvar, pslist_entry)
 
+/* Macros for key_sad.savlut */
+#define SAVLUT_READER_FOREACH(sav, dst, proto, hash_key)		\
+	PSLIST_READER_FOREACH((sav),	\
+	&key_sad.savlut[key_savluthash(dst, proto, hash_key,		\
+	  key_sad.savlutmask)],\
+	struct secasvar, pslist_entry_savlut)
+#define SAVLUT_WRITER_INSERT_HEAD(sav)	\
+	key_savlut_writer_insert_head((sav))
+#define SAVLUT_WRITER_REMOVE(sav)	\
+	do {\
+		if (!(sav)->savlut_added)\
+			break;		\
+		PSLIST_WRITER_REMOVE((sav), pslist_entry_savlut);	\
+		(sav)->savlut_added = false;\
+	} while(0)
 
 /* search order for SAs */
 	/*
@@ -807,8 +831,13 @@ static struct callout	key_timehandler_ch
 static struct workqueue	*key_timehandler_wq;
 static struct work	key_timehandler_wk;
 
+static inline void
+key_savlut_writer_insert_head(struct secasvar *sav);
 static inline uint32_t
 key_saidxhash(const struct secasindex *, u_long);
+static inline uint32_t
+key_savluthash(const struct sockaddr *,
+uint32_t, uint32_t, u_long);
 
 /*
  * Utilities for percpu counters for sadb_lifetime_allocations and
@@ -1219,9 +1248,7 @@ key_lookup_sa(
 	u_int16_t dport,
 	const char* where, int tag)
 {
-	struct secashead *sah;
 	struct secasvar *sav;
-	u_int state;
 	int chkport;
 	int s;
 
@@ -1229,6 +1256,7 @@ key_lookup_sa(
 	int must_check_alg = 0;
 	u_int16_t cpi = 0;
 	u_int8_t algo = 0;
+	uint32_t hash_key = spi;
 
 	if ((sport != 0) && (dport != 0))
 		chkport = PORT_STRICT;
@@ -1251,6 +1279,7 @@ key_lookup_sa(
 		cpi = (u_int16_t) tmp;
 		if (cpi < IPCOMP_CPI_NEGOTIATE_MIN) {
 			algo = (u_int8_t) cpi;
+			hash_key = algo;
 			must_check_spi = 0;
 			must_check_alg = 1;
 		}
@@ -1267,57 +1296,51 @@ key_lookup_sa(
 	 * encrypted so we can't check internal IP header.
 	 */
 	s = pserialize_read_enter();
-	SAHLIST_READER_FOREACH(sah) {
-		/* 

CVS commit: src/sys/netipsec

2018-04-16 Thread Shoichi YAMAGUCHI
Module Name:src
Committed By:   yamaguchi
Date:   Mon Apr 16 08:52:09 UTC 2018

Modified Files:
src/sys/netipsec: key.c

Log Message:
Introduced a hash table to sahlist

An saidx of sah included in the list is unique so that
the search can use a hash list whose hash is calculated by
the saidx to find an sah quickly.
The hash list of the sahlits is used in FreeBSD, too.

reviewed by ozaki-r@n.o, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.250 -r1.251 src/sys/netipsec/key.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netipsec/key.c
diff -u src/sys/netipsec/key.c:1.250 src/sys/netipsec/key.c:1.251
--- src/sys/netipsec/key.c:1.250	Mon Apr  9 06:26:05 2018
+++ src/sys/netipsec/key.c	Mon Apr 16 08:52:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: key.c,v 1.250 2018/04/09 06:26:05 yamaguchi Exp $	*/
+/*	$NetBSD: key.c,v 1.251 2018/04/16 08:52:09 yamaguchi Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/key.c,v 1.3.2.3 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: key.c,v 1.191 2001/06/27 10:46:49 sakane Exp $	*/
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.250 2018/04/09 06:26:05 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: key.c,v 1.251 2018/04/16 08:52:09 yamaguchi Exp $");
 
 /*
  * This code is referred to RFC 2367
@@ -72,6 +72,7 @@ __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.25
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -119,6 +120,10 @@ __KERNEL_RCSID(0, "$NetBSD: key.c,v 1.25
 #define PORT_LOOSE	1
 #define PORT_STRICT	2
 
+#ifndef SAHHASH_NHASH
+#define SAHHASH_NHASH		128
+#endif
+
 percpu_t *pfkeystat_percpu;
 
 /*
@@ -201,20 +206,20 @@ static u_int32_t acq_seq = 0;
 /*
  * Locking notes on SAD:
  * - Data structures
- *   - SAs are managed by the list called key_sad.sahlist and sav lists of sah
- * entries
+ *   - SAs are managed by the list called key_sad.sahlists and sav lists of
+ * sah entries
  * - An sav is supposed to be an SA from a viewpoint of users
  *   - A sah has sav lists for each SA state
- *   - Multiple sahs with the same saidx can exist
+ *   - Multiple saves with the same saidx can exist
  * - Only one entry has MATURE state and others should be DEAD
  * - DEAD entries are just ignored from searching
- * - Modifications to the key_sad.sahlist and sah.savlist must be done with
+ * - Modifications to the key_sad.sahlists and sah.savlist must be done with
  *   holding key_sad.lock which is a adaptive mutex
- * - Read accesses to the key_sad.sahlist and sah.savlist must be in
+ * - Read accesses to the key_sad.sahlists and sah.savlist must be in
  *   pserialize(9) read sections
  * - sah's lifetime is managed by localcount(9)
  * - Getting an sah entry
- *   - We get an sah from the key_sad.sahlist
+ *   - We get an sah from the key_sad.sahlists
  * - Must iterate the list and increment the reference count of a found sah
  *   (by key_sah_ref) in a pserialize read section
  *   - A gotten sah must be released after use by key_sah_unref
@@ -258,7 +263,8 @@ static struct {
 static struct {
 	kmutex_t lock;
 	kcondvar_t cv_lc;
-	struct pslist_head sahlist;
+	struct pslist_head *sahlists;
+	u_long sahlistmask;
 
 	pserialize_t psz;
 	kcondvar_t cv_psz;
@@ -338,13 +344,23 @@ static struct {
 #define SAHLIST_WRITER_REMOVE(sah)	\
 	PSLIST_WRITER_REMOVE((sah), pslist_entry)
 #define SAHLIST_READER_FOREACH(sah)	\
-	PSLIST_READER_FOREACH((sah), &key_sad.sahlist, struct secashead,\
-	  pslist_entry)
+	for(int _i_sah = 0; _i_sah <= key_sad.sahlistmask; _i_sah++)	\
+		PSLIST_READER_FOREACH((sah), &key_sad.sahlists[_i_sah],	\
+		  struct secashead, pslist_entry)
+#define SAHLIST_READER_FOREACH_SAIDX(sah, saidx)			\
+	PSLIST_READER_FOREACH((sah),	\
+	&key_sad.sahlists[key_saidxhash((saidx),			\
+	   key_sad.sahlistmask)],			\
+	struct secashead, pslist_entry)
 #define SAHLIST_WRITER_FOREACH(sah)	\
-	PSLIST_WRITER_FOREACH((sah), &key_sad.sahlist, struct secashead,\
-	  pslist_entry)
+	for(int _i_sah = 0; _i_sah <= key_sad.sahlistmask; _i_sah++)	\
+		PSLIST_WRITER_FOREACH((sah), &key_sad.sahlists[_i_sah],	\
+		 struct secashead, pslist_entry)
 #define SAHLIST_WRITER_INSERT_HEAD(sah)	\
-	PSLIST_WRITER_INSERT_HEAD(&key_sad.sahlist, (sah), pslist_entry)
+	PSLIST_WRITER_INSERT_HEAD(	\
+	&key_sad.sahlists[key_saidxhash(&(sah)->saidx,		\
+	  key_sad.sahlistmask)],	\
+	(sah), pslist_entry)
 
 /* Macros for key_sad.sahlist#savlist */
 #define SAVLIST_ENTRY_INIT(sav)		\
@@ -791,6 +807,9 @@ static struct callout	key_timehandler_ch
 static struct workqueue	*key_timehandler_wq;
 static struct work	key_timehandler_wk;
 
+static inline uint32_t
+key_saidxhash(const struct secasindex *, u_long);
+
 /*
  * Utilities for percpu counters for sadb_lifetime_

CVS commit: src/sys/dev/pci

2018-04-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Apr 16 08:31:06 UTC 2018

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.572 -r1.573 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.572 src/sys/dev/pci/if_wm.c:1.573
--- src/sys/dev/pci/if_wm.c:1.572	Fri Apr 13 09:35:10 2018
+++ src/sys/dev/pci/if_wm.c	Mon Apr 16 08:31:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.572 2018/04/13 09:35:10 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.573 2018/04/16 08:31:06 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.572 2018/04/13 09:35:10 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.573 2018/04/16 08:31:06 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -384,7 +384,7 @@ struct wm_txqueue {
 		/* XXX not used? */
 
 	WM_Q_EVCNT_DEFINE(txq, txipsum)		/* IP checksums comp. out-bound */
-	WM_Q_EVCNT_DEFINE(txq,txtusum)		/* TCP/UDP cksums comp. out-bound */
+	WM_Q_EVCNT_DEFINE(txq, txtusum)		/* TCP/UDP cksums comp. out-bound */
 	WM_Q_EVCNT_DEFINE(txq, txtusum6)	/* TCP/UDP v6 cksums comp. out-bound */
 	WM_Q_EVCNT_DEFINE(txq, txtso)		/* TCP seg offload out-bound (IPv4) */
 	WM_Q_EVCNT_DEFINE(txq, txtso6)		/* TCP seg offload out-bound (IPv6) */
@@ -442,7 +442,7 @@ struct wm_rxqueue {
 };
 
 struct wm_queue {
-	int wmq_id;			/* index of transmit and receive queues */
+	int wmq_id;			/* index of TX/RX queues */
 	int wmq_intr_idx;		/* index of MSI-X tables */
 
 	uint32_t wmq_itr;		/* interrupt interval per queue. */
@@ -690,8 +690,10 @@ static int	wm_detach(device_t, int);
 static bool	wm_suspend(device_t, const pmf_qual_t *);
 static bool	wm_resume(device_t, const pmf_qual_t *);
 static void	wm_watchdog(struct ifnet *);
-static void	wm_watchdog_txq(struct ifnet *, struct wm_txqueue *, uint16_t *);
-static void	wm_watchdog_txq_locked(struct ifnet *, struct wm_txqueue *, uint16_t *);
+static void	wm_watchdog_txq(struct ifnet *, struct wm_txqueue *,
+uint16_t *);
+static void	wm_watchdog_txq_locked(struct ifnet *, struct wm_txqueue *,
+uint16_t *);
 static void	wm_tick(void *);
 static int	wm_ifflags_cb(struct ethercom *);
 static int	wm_ioctl(struct ifnet *, u_long, void *);
@@ -765,14 +767,16 @@ static void	wm_start(struct ifnet *);
 static void	wm_start_locked(struct ifnet *);
 static int	wm_transmit(struct ifnet *, struct mbuf *);
 static void	wm_transmit_locked(struct ifnet *, struct wm_txqueue *);
-static void	wm_send_common_locked(struct ifnet *, struct wm_txqueue *, bool);
+static void	wm_send_common_locked(struct ifnet *, struct wm_txqueue *,
+bool);
 static int	wm_nq_tx_offload(struct wm_softc *, struct wm_txqueue *,
 struct wm_txsoft *, uint32_t *, uint32_t *, bool *);
 static void	wm_nq_start(struct ifnet *);
 static void	wm_nq_start_locked(struct ifnet *);
 static int	wm_nq_transmit(struct ifnet *, struct mbuf *);
 static void	wm_nq_transmit_locked(struct ifnet *, struct wm_txqueue *);
-static void	wm_nq_send_common_locked(struct ifnet *, struct wm_txqueue *, bool);
+static void	wm_nq_send_common_locked(struct ifnet *, struct wm_txqueue *,
+bool);
 static void	wm_deferred_start_locked(struct wm_txqueue *);
 static void	wm_handle_queue(void *);
 /* Interrupt */
@@ -797,7 +801,7 @@ static int	wm_linkintr_msix(void *);
 static void	wm_tbi_serdes_set_linkled(struct wm_softc *);
 /* GMII related */
 static void	wm_gmii_reset(struct wm_softc *);
-static void	wm_gmii_setup_phytype(struct wm_softc *sc, uint32_t, uint16_t);
+static void	wm_gmii_setup_phytype(struct wm_softc *, uint32_t, uint16_t);
 static int	wm_get_phy_id_82575(struct wm_softc *);
 static void	wm_gmii_mediainit(struct wm_softc *, pci_product_id_t);
 static int	wm_gmii_mediachange(struct ifnet *);
@@ -3014,7 +3018,8 @@ wm_watchdog_txq(struct ifnet *ifp, struc
 }
 
 static void
-wm_watchdog_txq_locked(struct ifnet *ifp, struct wm_txqueue *txq, uint16_t *hang)
+wm_watchdog_txq_locked(struct ifnet *ifp, struct wm_txqueue *txq,
+uint16_t *hang)
 {
 	struct wm_softc *sc = ifp->if_softc;
 	struct wm_queue *wmq = container_of(txq, struct wm_queue, wmq_txq);
@@ -4324,7 +4329,7 @@ wm_flush_desc_rings(struct wm_softc *sc)
 	nexttx = txq->txq_next;
 	txd = &txq->txq_descs[nexttx];
 	wm_set_dma_addr(&txd->wtx_addr, WM_CDTXADDR(txq, nexttx));
-	txd->wtx_cmdlen = htole32(WTX_CMD_IFCS| 512);
+	txd->wtx_cmdlen = htole32(WTX_CMD_IFCS | 512);
 	txd->wtx_fields.wtxu_status = 0;
 	txd->wtx_fields.wtxu_options = 0;
 	txd->wtx_fields.wtxu_vlan = 0;
@@ -4839,8 +4844,7 @@ wm_add_rxbuf(struct wm_rxqueue *rxq, int
 	if (error) {
 		/* XXX XXX XXX */
 		aprint_error_dev(sc->sc_dev,
-		"unable to load rx DMA map %d, error = %d\n

CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2018-04-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Mon Apr 16 08:17:18 UTC 2018

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: libnetpgp.3

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.21 src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.22
--- src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.21	Sun Apr 15 23:00:36 2018
+++ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3	Mon Apr 16 08:17:18 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgp.3,v 1.21 2018/04/15 23:00:36 sevan Exp $
+.\" $NetBSD: libnetpgp.3,v 1.22 2018/04/16 08:17:18 wiz Exp $
 .\"
 .\" Copyright (c) 2009,2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -173,7 +173,7 @@ Normal operation sees the
 process be initialised using the
 .Fn netpgp_init
 function, which will set up the public and private keyrings, as well as set the
-user identity in the 
+user identity in the
 .Ar userid
 member of the
 .Dv netpgp_t