CVS commit: src/usr.sbin/sysinst

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 07:31:15 UTC 2020

Modified Files:
src/usr.sbin/sysinst: bsddisklabel.c defs.h disks.c

Log Message:
Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/usr.sbin/sysinst/bsddisklabel.c
cvs rdiff -u -r1.52 -r1.53 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.60 -r1.61 src/usr.sbin/sysinst/disks.c

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

Modified files:

Index: src/usr.sbin/sysinst/bsddisklabel.c
diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.36 src/usr.sbin/sysinst/bsddisklabel.c:1.37
--- src/usr.sbin/sysinst/bsddisklabel.c:1.36	Mon Jan 20 21:26:35 2020
+++ src/usr.sbin/sysinst/bsddisklabel.c	Fri Jan 24 07:31:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bsddisklabel.c,v 1.36 2020/01/20 21:26:35 martin Exp $	*/
+/*	$NetBSD: bsddisklabel.c,v 1.37 2020/01/24 07:31:15 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -929,7 +929,7 @@ fill_defaults(struct partition_usage_set
 	memcpy(wanted->infos, default_parts_init, sizeof(default_parts_init));
 
 #ifdef HAVE_TMPFS
-	if (get_ramsize() > 96) {
+	if (get_ramsize() >= SMALL_RAM_SIZE) {
 		for (i = 0; i < wanted->num; i++) {
 			if (wanted->infos[i].type != PT_root ||
 			wanted->infos[i].fs_type != FS_TMPFS)

Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.52 src/usr.sbin/sysinst/defs.h:1.53
--- src/usr.sbin/sysinst/defs.h:1.52	Mon Jan 20 21:26:35 2020
+++ src/usr.sbin/sysinst/defs.h	Fri Jan 24 07:31:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.52 2020/01/20 21:26:35 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.53 2020/01/24 07:31:15 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -59,9 +59,21 @@ const char *getfslabelname(uint, uint);
 #define	MENUSTRSIZE	80
 #define SSTRSIZE	30
 
+/* these are used for different alignment defaults */
 #define	HUGE_DISK_SIZE	(daddr_t)(128 * (GIG / 512))
 #define	TINY_DISK_SIZE	(daddr_t)(1800 * (MEG / 512))
 
+/*
+ * if a system does not have more ram (in MB) than this, swap will be enabled
+ * very early (as soon as the swap partition has been created)
+ */
+#define	TINY_RAM_SIZE		32
+/*
+ * if a system has less ram (in MB) than this, we will not create a
+ * tmpfs /tmp by default (to workaround PR misc/54886)
+ */
+#define	SMALL_RAM_SIZE		256
+
 /* helper macros to create unique internal error messages */
 #define STR_NO(STR)	#STR
 #define	TO_STR(NO)	STR_NO(NO)

Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.60 src/usr.sbin/sysinst/disks.c:1.61
--- src/usr.sbin/sysinst/disks.c:1.60	Thu Jan 16 16:47:19 2020
+++ src/usr.sbin/sysinst/disks.c	Fri Jan 24 07:31:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: disks.c,v 1.60 2020/01/16 16:47:19 martin Exp $ */
+/*	$NetBSD: disks.c,v 1.61 2020/01/24 07:31:15 martin Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1889,7 +1889,7 @@ mount_disks(struct install_partition_des
 int
 set_swap_if_low_ram(struct install_partition_desc *install)
 {
-	if (get_ramsize() <= 32)
+	if (get_ramsize() <= TINY_RAM_SIZE)
 		return set_swap(install);
 	return 0;
 }



CVS commit: src/tests/lib/libc/sys

2020-01-24 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 24 08:45:16 UTC 2020

Modified Files:
src/tests/lib/libc/sys: t_mlock.c

Log Message:
Don't print the pagesize it messes up atf-report


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_mlock.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_mlock.c
diff -u src/tests/lib/libc/sys/t_mlock.c:1.7 src/tests/lib/libc/sys/t_mlock.c:1.8
--- src/tests/lib/libc/sys/t_mlock.c:1.7	Wed Mar 13 08:50:12 2019
+++ src/tests/lib/libc/sys/t_mlock.c	Fri Jan 24 08:45:16 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mlock.c,v 1.7 2019/03/13 08:50:12 kre Exp $ */
+/* $NetBSD: t_mlock.c,v 1.8 2020/01/24 08:45:16 skrll Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mlock.c,v 1.7 2019/03/13 08:50:12 kre Exp $");
+__RCSID("$NetBSD: t_mlock.c,v 1.8 2020/01/24 08:45:16 skrll Exp $");
 
 #include 
 #include 
@@ -302,7 +302,6 @@ ATF_TP_ADD_TCS(tp)
 {
 
 	page = sysconf(_SC_PAGESIZE);
-	fprintf(stderr, "t_mlock: pagesize %ld\n", page);
 	ATF_REQUIRE(page >= 0);
 
 	ATF_TP_ADD_TC(tp, mlock_clip);



CVS commit: src/doc

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 09:33:42 UTC 2020

Modified Files:
src/doc: TODO

Log Message:
Myself and I think dsl@ looked into sysenter/sysexit in 2007 and while it
was faster, it wasn't worth the trouble.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/doc/TODO

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

Modified files:

Index: src/doc/TODO
diff -u src/doc/TODO:1.19 src/doc/TODO:1.20
--- src/doc/TODO:1.19	Thu Feb 19 11:20:43 2015
+++ src/doc/TODO	Fri Jan 24 09:33:42 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: TODO,v 1.19 2015/02/19 11:20:43 mrg Exp $
+#	$NetBSD: TODO,v 1.20 2020/01/24 09:33:42 ad Exp $
 
 THINGS TO BE DONE:
 
@@ -36,10 +36,6 @@ High Kernel:
 User programs:
 rwall nfs-mountees on shutdown
 
-i386 kernel support:
-make use of sysenter/sysexit instructions on PIII/4 and Athlon for
-reducing syscall overhead.
-
 This is a list of suggested smaller projects (in no particular order):
 
 + speed up sort(1) by using mmap(2) rather than temp files



CVS commit: src/doc

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 10:15:40 UTC 2020

Modified Files:
src/doc: CHANGES

Log Message:
Add some recent changes I made.


To generate a diff of this commit:
cvs rdiff -u -r1.2642 -r1.2643 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2642 src/doc/CHANGES:1.2643
--- src/doc/CHANGES:1.2642	Thu Jan 23 02:57:25 2020
+++ src/doc/CHANGES	Fri Jan 24 10:15:40 2020
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2642 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2643 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -56,6 +56,7 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	bind: Import version 9.14.7. [christos 20191017]
 	libc: Changed the iconv(3) function signature to the POSIX variation
 		[kamil 20191024]
+	nct(4): Add Nuvoton NCT5104D GPIO driver. [ad 20191025]
 	vio9p(4): Add virtio-9p front-end driver. [ozaki-r 20191028]
 	mount_9p(8): Enable to mount a filesystem exported via virtio-9p.
 		[ozaki-r 20191028]
@@ -73,30 +74,61 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		Atom C2XXX, C3XXX, Xeon D-21XX and D-15XX, C62X chipsets and
 		QuickAssist Adapter 8960/8970.
 		[hikaru 20191120]
+	select(2), poll(2): Performance and scalability improvements
+		[ad 20191121]
+	amd64, i386: Performance and scalability improvements for TLB
+		shootdown [ad 20191121]
 	bind: Import version 9.14.8. [christos 20191127]
 	terminfo: Import 20190609 [christos 20191127]
+	onewire(4), owtemp(4): Improve reliability and reduce CPU overhead
+		slightly. [ad 20191130]
+	scheduler: Improve performance and interactivity. [ad 20191201]
+	vfs: Reduce false sharing and lock overhead during normal operation.
+		[ad 20191201]
 	ixl(4): Ported driver for Intel Ethernet 700 series
 		[yamaguchi 20191210]
 	acpi(4): Updated ACPICA to 20191213. [christos 20191214]
+	uvm: Replace red-black tree page lookup with radix tree lookup,
+		including tagging and gang lookup of pages.  Original work
+		done by yamt@. [ad 20191214]
 	nsd: Import 4.2.4. [christos 20191215]
 	unbound(8): Import 1.9.6. [christos 20191215]
 	openpam(3): update to 20190224 (tabebuia) [christos 20191215]
  	kerberos(8): Update to Heimdal-7.7.0 [christos 20191215]
 	file(1): Upgraded to 5.38. [christos 20191216]
+	uvm: Replace global counters with per-CPU counters, significantly
+		reducing system time on workloads that are VM-system heavy.
+		[ad 20191216]
 	anxdp(4): Add driver for Analogix DisplayPort core found in
 		Rockchip RK3399. [jakllsch 20191219]
 	net80211: Require SSID configuration to associate with an open AP.
 		[jakllsch 20191219]
 	dhcpcd(8): Import dhcpcd-8.1.4 [roy 20191220]
+	uvm: Rewrite the page allocator to be more efficient and somewhat CPU
+		topology aware.  Add preliminary NUMA support.  [ad 20191227]
 	crunchgen(1): Added the ability to pass variables in the submake
 		command line, and removed all command like flags that are
 		not needed anymore [christos 20191229]
+	uvm: Reduce lock contention by making the maintentance of page
+		replacement state more concurrent. [ad 20191231]
 	aq(4): Add Aquantia 10G network adapter driver [ryo 20200101]
 	dhcpcd(8): Import dhcpcd-8.1.5 [roy 20200103]
 	tmux(1): Imported 3.0a. [christos 20200106]
+	amd64, i386: Replace the global PV hash table with radix trees,
+		yielding significant performance and scalability benefits.
+		[ad 20200112]
+	amd64, i386: Use the pmap module as a source of pre-zeroed pages
+		for the VM system. [ad 20200112]
+	scheduler: Make the scheduler topology aware.  It understands and
+		makes good use of HyperThreading/SMT, spreads the load evenly
+		across different physical CPU packages, and can effectively
+		run asymmetric systems with slow and fast CPUs [ad 20200113]
 	evbarm: Add support for NXP i.MX 8M family SoCs. [jmcneill 20200114]
 	arm: Add support for cpu topology for ARMv7 and ARMv7 CPUs.
 		[mrg 20201114]
+	uvm: More precisely track clean/dirty pages, and change how they are
+		indexed, speeding up fsync() on large files by orders of
+		magnitude.  Original work done by yamt@. [ad 20200115]
 	uyurex(4): Removed from the tree. [maya 20200117]
 	strip(4): Removed from the tree. [thorpej 20200118]
 	hippi and esh(4): Removed from the tree. [thorpej 20200118]



CVS commit: src/sys/arch/arm/acpi

2020-01-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 24 10:49:41 UTC 2020

Modified Files:
src/sys/arch/arm/acpi: acpi_simplefb.c

Log Message:
Do not attach simplefb if the width or height are invalid


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/acpi_simplefb.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/arm/acpi/acpi_simplefb.c
diff -u src/sys/arch/arm/acpi/acpi_simplefb.c:1.1 src/sys/arch/arm/acpi/acpi_simplefb.c:1.2
--- src/sys/arch/arm/acpi/acpi_simplefb.c:1.1	Sun Sep 22 18:31:59 2019
+++ src/sys/arch/arm/acpi/acpi_simplefb.c	Fri Jan 24 10:49:41 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_simplefb.c,v 1.1 2019/09/22 18:31:59 jmcneill Exp $ */
+/* $NetBSD: acpi_simplefb.c,v 1.2 2020/01/24 10:49:41 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_simplefb.c,v 1.1 2019/09/22 18:31:59 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_simplefb.c,v 1.2 2020/01/24 10:49:41 jmcneill Exp $");
 
 #include 
 #include 
@@ -166,6 +166,9 @@ acpi_simplefb_preattach(void)
 	(format = fdtbus_get_string(phandle, "format")) == NULL)
 		return;
 
+	if (width == 0 || height == 0)
+		return;
+
 	if (strcmp(format, "a8b8g8r8") == 0 ||
 	strcmp(format, "x8r8g8b8") == 0) {
 		depth = 32;
@@ -198,6 +201,9 @@ acpi_simplefb_preattach(void)
 	vcons_init_screen(&acpi_simplefb_vcons_data, &acpi_simplefb_screen, 1, &defattr);
 	acpi_simplefb_screen.scr_flags |= VCONS_SCREEN_IS_STATIC;
 
+	if (ri->ri_rows < 1 || ri->ri_cols < 1)
+		return;
+
 	acpi_simplefb_stdscreen.nrows = ri->ri_rows;
 	acpi_simplefb_stdscreen.ncols = ri->ri_cols;
 	acpi_simplefb_stdscreen.textops = &ri->ri_ops;



CVS commit: src/sys/external/bsd/drm2/radeon

2020-01-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Jan 24 11:44:27 UTC 2020

Modified Files:
src/sys/external/bsd/drm2/radeon: radeon_pci.c

Log Message:
If radeon attaches, prevent simplefb from claiming the console


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/external/bsd/drm2/radeon/radeon_pci.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/external/bsd/drm2/radeon/radeon_pci.c
diff -u src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.13 src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.14
--- src/sys/external/bsd/drm2/radeon/radeon_pci.c:1.13	Mon Aug 27 14:12:14 2018
+++ src/sys/external/bsd/drm2/radeon/radeon_pci.c	Fri Jan 24 11:44:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeon_pci.c,v 1.13 2018/08/27 14:12:14 riastradh Exp $	*/
+/*	$NetBSD: radeon_pci.c,v 1.14 2020/01/24 11:44:27 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,10 +30,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.13 2018/08/27 14:12:14 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_pci.c,v 1.14 2020/01/24 11:44:27 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "vga.h"
+#if defined(__arm__) || defined(__aarch64__)
+#include "opt_fdt.h"
+#endif
 #endif
 
 #include 
@@ -60,6 +63,10 @@ __KERNEL_RCSID(0, "$NetBSD: radeon_pci.c
 #include 
 #endif
 
+#ifdef FDT
+#include 
+#endif
+
 #include 
 #include 
 
@@ -201,6 +208,15 @@ radeon_attach(device_t parent, device_t 
    "i386 radeondrmkms hack\n");
 #endif
 
+#ifdef FDT
+	/*
+	 * XXX Remove the simple framebuffer, assuming that this device
+	 * will take over.
+	 */
+	const char *fb_compatible[] = { "simple-framebuffer", NULL };
+	fdt_remove_bycompat(fb_compatible);
+#endif
+
 	config_mountroot(self, &radeon_attach_real);
 }
 



CVS commit: src/sys/lib/libsa

2020-01-24 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Fri Jan 24 13:20:33 UTC 2020

Modified Files:
src/sys/lib/libsa: ext2fs.c

Log Message:
Use dp->e2d_namlen rather than strlen(dp->e2d_name) in ext2fs_ls().

Prevents garbage beyond the end of the name from appearing on screen.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/lib/libsa/ext2fs.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/lib/libsa/ext2fs.c
diff -u src/sys/lib/libsa/ext2fs.c:1.28 src/sys/lib/libsa/ext2fs.c:1.29
--- src/sys/lib/libsa/ext2fs.c:1.28	Mon Jun 24 13:58:24 2019
+++ src/sys/lib/libsa/ext2fs.c	Fri Jan 24 13:20:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ext2fs.c,v 1.28 2019/06/24 13:58:24 pgoyette Exp $	*/
+/*	$NetBSD: ext2fs.c,v 1.29 2020/01/24 13:20:33 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.
@@ -866,7 +866,7 @@ ext2fs_ls(struct open_file *f, const cha
 goto out;
 			}
 			lsadd(&names, pattern, dp->e2d_name,
-			strlen(dp->e2d_name), fs2h32(dp->e2d_ino), t);
+			dp->e2d_namlen, fs2h32(dp->e2d_ino), t);
 		}
 		fp->f_seekp += buf_size;
 	}



CVS commit: [ad-namecache] src/sys

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 16:05:23 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_subr.c vfs_vnode.c
src/sys/miscfs/genfs [ad-namecache]: genfs_vnops.c
src/sys/sys [ad-namecache]: vnode.h vnode_impl.h

Log Message:
vnodes:

- Have own v_usecount again, don't share the uvm_object's refcount.
- Cluster the members of vnode_t and vnode_impl_t in a cache-concious way.
- Go back to having vi_lock directly in vnode_impl_t.
- Go back to having v_usecount adjusted with atomics.
- Start adjusting v_holdcnt with atomics, too.
- Put all the namecache stuff back into vnode_impl_t.


To generate a diff of this commit:
cvs rdiff -u -r1.478.2.1 -r1.478.2.2 src/sys/kern/vfs_subr.c
cvs rdiff -u -r1.105.2.4 -r1.105.2.5 src/sys/kern/vfs_vnode.c
cvs rdiff -u -r1.200.2.2 -r1.200.2.3 src/sys/miscfs/genfs/genfs_vnops.c
cvs rdiff -u -r1.286 -r1.286.2.1 src/sys/sys/vnode.h
cvs rdiff -u -r1.19.2.4 -r1.19.2.5 src/sys/sys/vnode_impl.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/kern/vfs_subr.c
diff -u src/sys/kern/vfs_subr.c:1.478.2.1 src/sys/kern/vfs_subr.c:1.478.2.2
--- src/sys/kern/vfs_subr.c:1.478.2.1	Fri Jan 17 21:47:35 2020
+++ src/sys/kern/vfs_subr.c	Fri Jan 24 16:05:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_subr.c,v 1.478.2.1 2020/01/17 21:47:35 ad Exp $	*/
+/*	$NetBSD: vfs_subr.c,v 1.478.2.2 2020/01/24 16:05:22 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008, 2019
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.478.2.1 2020/01/17 21:47:35 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.478.2.2 2020/01/24 16:05:22 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -,7 +,7 @@ vprint_common(struct vnode *vp, const ch
 	vp->v_usecount, vp->v_writecount, vp->v_holdcnt);
 	(*pr)("%ssize %" PRIx64 " writesize %" PRIx64 " numoutput %d\n",
 	prefix, vp->v_size, vp->v_writesize, vp->v_numoutput);
-	(*pr)("%sdata %p lock %p\n", prefix, vp->v_data, vip->vi_lock);
+	(*pr)("%sdata %p lock %p\n", prefix, vp->v_data, &vip->vi_lock);
 
 	(*pr)("%sstate %s key(%p %zd)", prefix, vstate_name(vip->vi_state),
 	vip->vi_key.vk_mount, vip->vi_key.vk_key_len);
@@ -1544,7 +1544,7 @@ vfs_vnode_lock_print(void *vlock, int fu
 
 	for (mp = _mountlist_next(NULL); mp; mp = _mountlist_next(mp)) {
 		TAILQ_FOREACH(vip, &mp->mnt_vnodelist, vi_mntvnodes) {
-			if (vip->vi_lock == vlock ||
+			if (&vip->vi_lock == vlock ||
 			VIMPL_TO_VNODE(vip)->v_interlock == vlock)
 vfs_vnode_print(VIMPL_TO_VNODE(vip), full, pr);
 		}

Index: src/sys/kern/vfs_vnode.c
diff -u src/sys/kern/vfs_vnode.c:1.105.2.4 src/sys/kern/vfs_vnode.c:1.105.2.5
--- src/sys/kern/vfs_vnode.c:1.105.2.4	Thu Jan 23 19:28:39 2020
+++ src/sys/kern/vfs_vnode.c	Fri Jan 24 16:05:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnode.c,v 1.105.2.4 2020/01/23 19:28:39 ad Exp $	*/
+/*	$NetBSD: vfs_vnode.c,v 1.105.2.5 2020/01/24 16:05:22 ad Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011, 2019 The NetBSD Foundation, Inc.
@@ -142,10 +142,19 @@
  *	as vput(9), routines.  Common points holding references are e.g.
  *	file openings, current working directory, mount points, etc.  
  *
+ * Note on v_usecount & v_holdcnt and their locking
+ *
+ *	At nearly all points it is known that the counts could be zero,
+ *	the vnode_t::v_interlock will be held.  To change the counts away
+ *	from zero, the interlock must be held.  To change from a non-zero
+ *	value to zero, again the interlock must be held.
+ *
+ *	Changing the usecount from a non-zero value to a non-zero value can
+ *	safely be done using atomic operations, without the interlock held.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.105.2.4 2020/01/23 19:28:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.105.2.5 2020/01/24 16:05:22 ad Exp $");
 
 #include 
 #include 
@@ -669,6 +678,27 @@ vdrain_thread(void *cookie)
 }
 
 /*
+ * Try to drop reference on a vnode.  Abort if we are releasing the
+ * last reference.  Note: this _must_ succeed if not the last reference.
+ */
+static bool
+vtryrele(vnode_t *vp)
+{
+	u_int use, next;
+
+	for (use = vp->v_usecount;; use = next) {
+		if (__predict_false(use == 1)) {
+			return false;
+		}
+		KASSERT(use > 1);
+		next = atomic_cas_uint(&vp->v_usecount, use, use - 1);
+		if (__predict_true(next == use)) {
+			return true;
+		}
+	}
+}
+
+/*
  * vput: unlock and release the reference.
  */
 void
@@ -676,7 +706,20 @@ vput(vnode_t *vp)
 {
 	int lktype;
 
-	if ((vp->v_vflag & VV_LOCKSWORK) == 0) {
+	/*
+	 * Do an unlocked check of v_usecount.  If it looks like we're not
+	 * about to drop the last reference, then unlock the vnode and try
+	 * to drop the reference.  If it ends up being the last reference
+	 * after all, we dropped the lock when we shouldn't have.  vrelel()
+	 * can fix it all up.  Most of the time this will all go to 

CVS commit: [ad-namecache] src/sys/kern

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 16:05:37 UTC 2020

Modified Files:
src/sys/kern [ad-namecache]: vfs_lookup.c

Log Message:
Add a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.212.4.7 -r1.212.4.8 src/sys/kern/vfs_lookup.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/vfs_lookup.c
diff -u src/sys/kern/vfs_lookup.c:1.212.4.7 src/sys/kern/vfs_lookup.c:1.212.4.8
--- src/sys/kern/vfs_lookup.c:1.212.4.7	Thu Jan 23 21:23:56 2020
+++ src/sys/kern/vfs_lookup.c	Fri Jan 24 16:05:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lookup.c,v 1.212.4.7 2020/01/23 21:23:56 ad Exp $	*/
+/*	$NetBSD: vfs_lookup.c,v 1.212.4.8 2020/01/24 16:05:37 ad Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.212.4.7 2020/01/23 21:23:56 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.212.4.8 2020/01/24 16:05:37 ad Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_magiclinks.h"
@@ -1324,6 +1324,7 @@ lookup_fastforward(struct namei_state *s
 
 		/* Scored a hit.  Negative is good too (ENOENT). */
 		if (foundobj == NULL) {
+			/* XXXAD need to handle -o union mount. */
 			error = ENOENT;
 			break;
 		}



CVS commit: [ad-namecache] src/sys

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 16:48:59 UTC 2020

Modified Files:
src/sys/fs/tmpfs [ad-namecache]: tmpfs_subr.c tmpfs_vfsops.c
src/sys/kern [ad-namecache]: vfs_cache.c
src/sys/sys [ad-namecache]: namei.src
src/sys/ufs/ffs [ad-namecache]: ffs_vfsops.c
src/sys/ufs/ufs [ad-namecache]: ufs_vnops.c

Log Message:
- Put all the namecache stuff back into vnode_impl_t.
- Tidy vfs_cache.c up, finish the comments.
- Finalise how ID information is entered to the cache.
- Handle very small/old systems.


To generate a diff of this commit:
cvs rdiff -u -r1.105.2.1 -r1.105.2.2 src/sys/fs/tmpfs/tmpfs_subr.c
cvs rdiff -u -r1.75.2.2 -r1.75.2.3 src/sys/fs/tmpfs/tmpfs_vfsops.c
cvs rdiff -u -r1.126.2.10 -r1.126.2.11 src/sys/kern/vfs_cache.c
cvs rdiff -u -r1.47.2.5 -r1.47.2.6 src/sys/sys/namei.src
cvs rdiff -u -r1.362.4.3 -r1.362.4.4 src/sys/ufs/ffs/ffs_vfsops.c
cvs rdiff -u -r1.248.2.1 -r1.248.2.2 src/sys/ufs/ufs/ufs_vnops.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/fs/tmpfs/tmpfs_subr.c
diff -u src/sys/fs/tmpfs/tmpfs_subr.c:1.105.2.1 src/sys/fs/tmpfs/tmpfs_subr.c:1.105.2.2
--- src/sys/fs/tmpfs/tmpfs_subr.c:1.105.2.1	Fri Jan 17 22:26:25 2020
+++ src/sys/fs/tmpfs/tmpfs_subr.c	Fri Jan 24 16:48:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_subr.c,v 1.105.2.1 2020/01/17 22:26:25 ad Exp $	*/
+/*	$NetBSD: tmpfs_subr.c,v 1.105.2.2 2020/01/24 16:48:58 ad Exp $	*/
 
 /*
  * Copyright (c) 2005-2013 The NetBSD Foundation, Inc.
@@ -73,7 +73,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.105.2.1 2020/01/17 22:26:25 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_subr.c,v 1.105.2.2 2020/01/24 16:48:58 ad Exp $");
 
 #include 
 #include 
@@ -148,7 +148,7 @@ tmpfs_init_vnode(struct vnode *vp, tmpfs
 	node->tn_vnode = vp;
 	uvm_vnp_setsize(vp, node->tn_size);
 	KASSERT(node->tn_mode != VNOVAL);
-	cache_set_id(vp, node->tn_mode, node->tn_uid, node->tn_gid);
+	cache_enter_id(vp, node->tn_mode, node->tn_uid, node->tn_gid);
 }
 
 /*
@@ -1039,7 +1039,7 @@ tmpfs_chmod(vnode_t *vp, mode_t mode, ka
 	node->tn_mode = (mode & ALLPERMS);
 	tmpfs_update(vp, TMPFS_UPDATE_CTIME);
 	VN_KNOTE(vp, NOTE_ATTRIB);
-	cache_update_id(vp, node->tn_mode, node->tn_uid, node->tn_gid);
+	cache_enter_id(vp, node->tn_mode, node->tn_uid, node->tn_gid);
 	return 0;
 }
 
@@ -1084,7 +1084,7 @@ tmpfs_chown(vnode_t *vp, uid_t uid, gid_
 	node->tn_gid = gid;
 	tmpfs_update(vp, TMPFS_UPDATE_CTIME);
 	VN_KNOTE(vp, NOTE_ATTRIB);
-	cache_update_id(vp, node->tn_mode, node->tn_uid, node->tn_gid);
+	cache_enter_id(vp, node->tn_mode, node->tn_uid, node->tn_gid);
 	return 0;
 }
 

Index: src/sys/fs/tmpfs/tmpfs_vfsops.c
diff -u src/sys/fs/tmpfs/tmpfs_vfsops.c:1.75.2.2 src/sys/fs/tmpfs/tmpfs_vfsops.c:1.75.2.3
--- src/sys/fs/tmpfs/tmpfs_vfsops.c:1.75.2.2	Sun Jan 19 21:21:54 2020
+++ src/sys/fs/tmpfs/tmpfs_vfsops.c	Fri Jan 24 16:48:58 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vfsops.c,v 1.75.2.2 2020/01/19 21:21:54 ad Exp $	*/
+/*	$NetBSD: tmpfs_vfsops.c,v 1.75.2.3 2020/01/24 16:48:58 ad Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.75.2.2 2020/01/19 21:21:54 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.75.2.3 2020/01/24 16:48:58 ad Exp $");
 
 #include 
 #include 
@@ -182,7 +182,8 @@ tmpfs_mount(struct mount *mp, const char
 	mp->mnt_stat.f_namemax = TMPFS_MAXNAMLEN;
 	mp->mnt_fs_bshift = PAGE_SHIFT;
 	mp->mnt_dev_bshift = DEV_BSHIFT;
-	mp->mnt_iflag |= IMNT_MPSAFE | IMNT_CAN_RWTORO | IMNT_SHRLOOKUP;
+	mp->mnt_iflag |= IMNT_MPSAFE | IMNT_CAN_RWTORO | IMNT_SHRLOOKUP |
+	IMNT_NCLOOKUP;
 	vfs_getnewfsid(mp);
 
 	/* Allocate the tmpfs mount structure and fill it. */

Index: src/sys/kern/vfs_cache.c
diff -u src/sys/kern/vfs_cache.c:1.126.2.10 src/sys/kern/vfs_cache.c:1.126.2.11
--- src/sys/kern/vfs_cache.c:1.126.2.10	Thu Jan 23 12:33:18 2020
+++ src/sys/kern/vfs_cache.c	Fri Jan 24 16:48:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_cache.c,v 1.126.2.10 2020/01/23 12:33:18 ad Exp $	*/
+/*	$NetBSD: vfs_cache.c,v 1.126.2.11 2020/01/24 16:48:59 ad Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc.
@@ -64,45 +64,46 @@
  * Name caching:
  *
  *	Names found by directory scans are retained in a cache for future
- *	reference.  It is managed pseudo-LRU, so frequently used names will
- *	hang around.  The cache is indexed by directory.
+ *	reference.  It is managed LRU, so frequently used names will hang
+ *	around.  The cache is indexed by hash value obtained from the name.
  *
- * Background:
+ *	The name cache (or directory name lookup cache) is the brainchild of
+ *	Robert Elz and made its first appearance in 4.3BSD.
  *
- *	XXX add a bit of history
+ * Data structures:
  *
- * Data structures
- *
- *	Typically DNLCs use a global hash table for lookup, whi

CVS commit: [ad-namecache] src/sys/sys

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 16:49:12 UTC 2020

Modified Files:
src/sys/sys [ad-namecache]: namei.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.103.2.4 -r1.103.2.5 src/sys/sys/namei.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/sys/namei.h
diff -u src/sys/sys/namei.h:1.103.2.4 src/sys/sys/namei.h:1.103.2.5
--- src/sys/sys/namei.h:1.103.2.4	Sun Jan 19 21:24:01 2020
+++ src/sys/sys/namei.h	Fri Jan 24 16:49:12 2020
@@ -1,11 +1,11 @@
-/*	$NetBSD: namei.h,v 1.103.2.4 2020/01/19 21:24:01 ad Exp $	*/
+/*	$NetBSD: namei.h,v 1.103.2.5 2020/01/24 16:49:12 ad Exp $	*/
 
 
 /*
  * WARNING: GENERATED FILE.  DO NOT EDIT
  * (edit namei.src and run make namei in src/sys/sys)
  *   by:   NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp 
- *   from: NetBSD: namei.src,v 1.47.2.5 2020/01/19 21:19:25 ad Exp 
+ *   from: NetBSD: namei.src,v 1.47.2.6 2020/01/24 16:48:59 ad Exp 
  */
 
 /*
@@ -227,14 +227,13 @@ struct namecache {
 	struct	rb_node nc_tree;	/* d  red-black tree, must be first */
 	TAILQ_ENTRY(namecache) nc_list;	/* v  vp's list of cache entries */
 	TAILQ_ENTRY(namecache) nc_lru;	/* l  pseudo-lru chain */
-	struct	nchnode *nc_dnn;	/* -  nchnode of parent of name */
-	struct	nchnode *nc_nn;		/* -  nchnode the name refers to */
+	struct	vnode *nc_dvp;		/* -  vnode of parent of name */
 	struct	vnode *nc_vp;		/* -  vnode the name refers to */
 	int64_t	nc_key;			/* -  hash key */
 	int	nc_lrulist;		/* l  which LRU list its on */
 	short	nc_nlen;		/* -  length of the name */
 	char	nc_whiteout;		/* -  true if a whiteout */
-	char	nc_name[33];		/* -  segment name */
+	char	nc_name[41];		/* -  segment name */
 };
 #endif
 
@@ -305,8 +304,7 @@ int	cache_revlookup(struct vnode *, stru
 int	cache_diraccess(struct vnode *, int);
 void	cache_enter(struct vnode *, struct vnode *,
 			const char *, size_t, uint32_t);
-void	cache_set_id(struct vnode *, mode_t, uid_t, gid_t);
-void	cache_update_id(struct vnode *, mode_t, uid_t, gid_t);
+void	cache_enter_id(struct vnode *, mode_t, uid_t, gid_t);
 bool	cache_have_id(struct vnode *);
 void	cache_vnode_init(struct vnode * );
 void	cache_vnode_fini(struct vnode * );
@@ -340,8 +338,6 @@ void	namecache_print(struct vnode *, voi
 	type	ncs_revhits;	/* reverse-cache hits */		\
 	type	ncs_revmiss;	/* reverse-cache misses */		\
 	type	ncs_collisions;	/* hash value collisions */		\
-	type	ncs_active;	/* active cache entries */		\
-	type	ncs_inactive;	/* inactive cache entries */		\
 	type	ncs_denied;	/* access denied */			\
 }
 



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

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 18:40:46 UTC 2020

Modified Files:
src/sys/dev/mii [netbsd-8]: ihphy.c

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

sys/dev/mii/ihphy.c: revision 1.15

 Remove extra 10ms delay in ihphy_reset(). The delay are in if_wm.c side.
It's required for hardware full reset and it's not required on soft reset.

 When ihphy.c was added in 9 years ago, some workaround code were not in
if_wm.c yet and the initialization code was not good.


To generate a diff of this commit:
cvs rdiff -u -r1.10.8.1 -r1.10.8.2 src/sys/dev/mii/ihphy.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/mii/ihphy.c
diff -u src/sys/dev/mii/ihphy.c:1.10.8.1 src/sys/dev/mii/ihphy.c:1.10.8.2
--- src/sys/dev/mii/ihphy.c:1.10.8.1	Thu Aug  1 14:27:30 2019
+++ src/sys/dev/mii/ihphy.c	Fri Jan 24 18:40:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ihphy.c,v 1.10.8.1 2019/08/01 14:27:30 martin Exp $	*/
+/*	$NetBSD: ihphy.c,v 1.10.8.2 2020/01/24 18:40:45 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.10.8.1 2019/08/01 14:27:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.10.8.2 2020/01/24 18:40:45 martin Exp $");
 
 #include 
 #include 
@@ -296,14 +296,6 @@ ihphy_reset(struct mii_softc *sc)
 
 	PHY_WRITE(sc, MII_BMCR, BMCR_RESET | BMCR_ISO);
 
-	/*
-	 * Regarding reset, the data sheet specifies (page 55):
-	 *
-	 * "After PHY reset, a delay of 10 ms is required before
-	 *  any register access using MDIO."
-	 */
-	delay(1);
-
 	/* Wait another 100ms for it to complete. */
 	for (i = 0; i < 100; i++) {
 		reg = PHY_READ(sc, MII_BMCR);



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

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 18:37:32 UTC 2020

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: if_bypass.c ix_txrx.c ixgbe.c ixgbe.h
ixgbe_82598.c ixgbe_api.c ixgbe_common.c ixgbe_netbsd.c
ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixv.c

Log Message:
Pull up the following, requested by msaitoh in ticket #1490:

sys/dev/pci/ixgbe/if_bypass.c   1.5
sys/dev/pci/ixgbe/ixgbe_osdep.c 1.5
sys/dev/pci/ixgbe/ix_txrx.c 1.58-1.60
sys/dev/pci/ixgbe/ixgbe.c   1.195,1.220-1.221 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.60-1.2
sys/dev/pci/ixgbe/ixgbe_api.c   1.24
sys/dev/pci/ixgbe/ixgbe_common.c1.26
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.11-1.12
sys/dev/pci/ixgbe/ixgbe_osdep.h 1.24
sys/dev/pci/ixgbe/ixgbe_phy.c   1.19
sys/dev/pci/ixgbe/ixgbe_82598.c 1.14
sys/dev/pci/ixgbe/ixv.c 1.122,1.142,1.144 via patch

- Use unsigned to avoid undefined behavior in
  ix{gbe,v}_[un]register_vlan().
- Free RX structure correctly when detaching.
- Remove unused code.
- Remove extra spaces.
- Fix some typos in comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.2.4.4 -r1.2.4.5 src/sys/dev/pci/ixgbe/if_bypass.c
cvs rdiff -u -r1.24.2.18 -r1.24.2.19 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.38 -r1.88.2.39 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.24.6.18 -r1.24.6.19 src/sys/dev/pci/ixgbe/ixgbe.h
cvs rdiff -u -r1.8.8.2 -r1.8.8.3 src/sys/dev/pci/ixgbe/ixgbe_82598.c
cvs rdiff -u -r1.15.8.5 -r1.15.8.6 src/sys/dev/pci/ixgbe/ixgbe_api.c
cvs rdiff -u -r1.13.2.7 -r1.13.2.8 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.6.2.4 -r1.6.2.5 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.1.12.3 -r1.1.12.4 src/sys/dev/pci/ixgbe/ixgbe_osdep.c
cvs rdiff -u -r1.17.6.5 -r1.17.6.6 src/sys/dev/pci/ixgbe/ixgbe_osdep.h
cvs rdiff -u -r1.11.6.4 -r1.11.6.5 src/sys/dev/pci/ixgbe/ixgbe_phy.c
cvs rdiff -u -r1.56.2.28 -r1.56.2.29 src/sys/dev/pci/ixgbe/ixv.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/ixgbe/if_bypass.c
diff -u src/sys/dev/pci/ixgbe/if_bypass.c:1.2.4.4 src/sys/dev/pci/ixgbe/if_bypass.c:1.2.4.5
--- src/sys/dev/pci/ixgbe/if_bypass.c:1.2.4.4	Sat Apr 14 10:25:11 2018
+++ src/sys/dev/pci/ixgbe/if_bypass.c	Fri Jan 24 18:37:31 2020
@@ -101,7 +101,7 @@ ixgbe_get_bypass_time(u32 *year, u32 *se
 	nanotime(¤t);
 	*sec = current.tv_sec;
 
-	while(*sec > SEC_THIS_YEAR(*year)) {
+	while (*sec > SEC_THIS_YEAR(*year)) {
 		*sec -= SEC_THIS_YEAR(*year);
 		(*year)++;
 	}

Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.18 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.19
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.18	Sun Nov 10 13:36:29 2019
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Fri Jan 24 18:37:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.18 2019/11/10 13:36:29 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.19 2020/01/24 18:37:31 martin Exp $ */
 
 /**
 
@@ -148,7 +148,7 @@ ixgbe_legacy_start_locked(struct ifnet *
 		return (ENETDOWN);
 	if (txr->txr_no_space)
 		return (ENETDOWN);
-	
+
 	while (!IFQ_IS_EMPTY(&ifp->if_snd)) {
 		if (txr->tx_avail <= IXGBE_QUEUE_MIN_FREE)
 			break;
@@ -1693,6 +1693,10 @@ ixgbe_free_receive_buffers(struct rx_rin
 rxbuf->pmap = NULL;
 			}
 		}
+
+		/* NetBSD specific. See ixgbe_netbsd.c */
+		ixgbe_jcl_destroy(adapter, rxr);
+
 		if (rxr->rx_buffers != NULL) {
 			free(rxr->rx_buffers, M_DEVBUF);
 			rxr->rx_buffers = NULL;
@@ -2379,3 +2383,24 @@ tx_fail:
 fail:
 	return (error);
 } /* ixgbe_allocate_queues */
+
+/
+ * ixgbe_free_queues
+ *
+ *   Free descriptors for the transmit and receive rings, and then
+ *   the memory associated with each.
+ /
+void
+ixgbe_free_queues(struct adapter *adapter)
+{
+	struct ix_queue *que;
+	int i;
+
+	ixgbe_free_transmit_structures(adapter);
+	ixgbe_free_receive_structures(adapter);
+	for (i = 0; i < adapter->num_queues; i++) {
+		que = &adapter->queues[i];
+		mutex_destroy(&que->dc_mtx);
+	}
+	free(adapter->queues, M_DEVBUF);
+} /* ixgbe_free_queues */

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.38 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.39
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.38	Thu Dec 26 20:25:07 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Fri Jan 24 18:37:31 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.38 2019/12/26 20:25:07 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.39 2020/01/24 18:37:31 martin Exp $ */
 
 /*

CVS commit: [netbsd-9] src/sbin/route

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 20:13:45 UTC 2020

Modified Files:
src/sbin/route [netbsd-9]: route.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #646):

sbin/route/route.c: revision 1.164
sbin/route/route.c: revision 1.165

route: Decode the correct flags for interface address messages
route: address flags are more useful than interface flags for address msgs


To generate a diff of this commit:
cvs rdiff -u -r1.160.2.3 -r1.160.2.4 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.160.2.3 src/sbin/route/route.c:1.160.2.4
--- src/sbin/route/route.c:1.160.2.3	Thu Sep  5 08:43:42 2019
+++ src/sbin/route/route.c	Fri Jan 24 20:13:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.160.2.3 2019/09/05 08:43:42 martin Exp $	*/
+/*	$NetBSD: route.c,v 1.160.2.4 2020/01/24 20:13:45 martin Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.160.2.3 2019/09/05 08:43:42 martin Exp $");
+__RCSID("$NetBSD: route.c,v 1.160.2.4 2020/01/24 20:13:45 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -54,6 +54,7 @@ __RCSID("$NetBSD: route.c,v 1.160.2.3 20
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1301,9 +1302,12 @@ const char * const msgtypes[] = {
 	[RTM_CHGADDR] = "RTM_CHGADDR: address being changed on iface",
 };
 
+const char unknownflags[] = "\020";
 const char metricnames[] = RTVBITS;
 const char routeflags[] = RTFBITS;
 const char ifnetflags[] = IFFBITS;
+const char in_ifflags[] = IN_IFFBITS;
+const char in6_ifflags[] = IN6_IFFBITS;
 const char addrnames[] = RTABITS;
 
 
@@ -1371,9 +1375,22 @@ print_rtmsg(struct rt_msghdr *rtm, int m
 	case RTM_DELADDR:
 	case RTM_CHGADDR:
 		ifam = (struct ifa_msghdr *)rtm;
-		(void)printf("pid %d, metric %d, flags: ",
+		(void)printf("pid %d, metric %d, addrflags: ",
 		ifam->ifam_pid, ifam->ifam_metric);
-		bprintf(stdout, ifam->ifam_flags, routeflags);
+		struct sockaddr *sa = (struct sockaddr *)(ifam + 1);
+		const char *bits;
+		switch (sa->sa_family) {
+		case AF_INET:
+			bits = in_ifflags;
+			break;
+		case AF_INET6:
+			bits = in6_ifflags;
+			break;
+		default:
+			bits = unknownflags;
+			break;
+		}
+		bprintf(stdout, ifam->ifam_addrflags, bits);
 		pmsg_addrs((char *)(ifam + 1), ifam->ifam_addrs);
 		break;
 	case RTM_IEEE80211:



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

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 18:43:35 UTC 2020

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c if_wmreg.h

Log Message:
Pull up the following, requested by msaitoh in ticket #1492:

sys/dev/pci/if_wm.c 1.650, 1.652-1.654 via patch
sys/dev/pci/if_wmreg.h  1.116-1.117

- Set CTRL_ILOS(Invert loss of signal) bit correctly on 82580
  port 1, 2, 3 and newer chips. This change fixes a bug that some
  fiber, serdes or SFP devices don't detect the link status correctly.
- Simplify code by using "struct mii_data *mii" more. No functional
  change.
- MSI-X doesn't use sc->sc_icr variable, so move the code into
  non-MSI-X part. No functional change intended.
- Modify debug printfs a bit.
- Rename macro.
- Use __BIT()
- Fix comment. Add comment.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.37 -r1.508.4.38 src/sys/dev/pci/if_wm.c
cvs rdiff -u -r1.98.6.10 -r1.98.6.11 src/sys/dev/pci/if_wmreg.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/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.37 src/sys/dev/pci/if_wm.c:1.508.4.38
--- src/sys/dev/pci/if_wm.c:1.508.4.37	Thu Jan 23 10:17:41 2020
+++ src/sys/dev/pci/if_wm.c	Fri Jan 24 18:43:35 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.37 2020/01/23 10:17:41 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.38 2020/01/24 18:43:35 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.37 2020/01/23 10:17:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.38 2020/01/24 18:43:35 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2645,10 +2645,11 @@ alloc_retry:
 		}
 	}
 
-	/* XXX For other than 82580? */
-	if (sc->sc_type == WM_T_82580) {
-		wm_nvm_read(sc, NVM_OFF_CFG3_PORTA, 1, &nvmword);
-		if (nvmword & __BIT(13))
+	if ((sc->sc_type >= WM_T_82580) && (sc->sc_type <= WM_T_I211)) {
+		wm_nvm_read(sc,
+		NVM_OFF_LAN_FUNC_82580(sc->sc_funcid) + NVM_OFF_CFG3_PORTA,
+		1, &nvmword);
+		if (nvmword & NVM_CFG3_ILOS)
 			sc->sc_ctrl |= CTRL_ILOS;
 	}
 
@@ -5981,8 +5982,7 @@ wm_init_locked(struct ifnet *ifp)
 
 	/* Set up the interrupt registers. */
 	CSR_WRITE(sc, WMREG_IMC, 0xU);
-	sc->sc_icr = ICR_TXDW | ICR_LSC | ICR_RXSEQ | ICR_RXDMT0 |
-	ICR_RXO | ICR_RXT0;
+
 	if (wm_is_using_msix(sc)) {
 		uint32_t mask;
 		struct wm_queue *wmq;
@@ -6022,8 +6022,11 @@ wm_init_locked(struct ifnet *ifp)
 			CSR_WRITE(sc, WMREG_IMS, ICR_LSC);
 			break;
 		}
-	} else
+	} else {
+		sc->sc_icr = ICR_TXDW | ICR_LSC | ICR_RXSEQ | ICR_RXDMT0 |
+		ICR_RXO | ICR_RXT0;
 		CSR_WRITE(sc, WMREG_IMS, sc->sc_icr);
+	}
 
 	/* Set up the inter-packet gap. */
 	CSR_WRITE(sc, WMREG_TIPG, sc->sc_tipg);
@@ -9098,7 +9101,7 @@ wm_linkintr_serdes(struct wm_softc *sc, 
 {
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
 	struct mii_data *mii = &sc->sc_mii;
-	struct ifmedia_entry *ife = sc->sc_mii.mii_media.ifm_cur;
+	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
 	uint32_t pcs_adv, pcs_lpab, reg;
 
 	DPRINTF(WM_DEBUG_LINK, ("%s: %s:\n", device_xname(sc->sc_dev),
@@ -9441,11 +9444,12 @@ wm_linkintr_msix(void *arg)
 	uint32_t reg;
 	bool has_rxo;
 
-	DPRINTF(WM_DEBUG_LINK,
-	("%s: LINK: got link intr\n", device_xname(sc->sc_dev)));
-
 	reg = CSR_READ(sc, WMREG_ICR);
 	WM_CORE_LOCK(sc);
+	DPRINTF(WM_DEBUG_LINK,
+	("%s: LINK: got link intr. ICR = %08x\n",
+		device_xname(sc->sc_dev), reg));
+
 	if (sc->sc_core_stopping)
 		goto out;
 
@@ -11180,7 +11184,7 @@ wm_gmii_statchg(struct ifnet *ifp)
 			sc->sc_ctrl |= CTRL_RFCE;
 	}
 
-	if (sc->sc_mii.mii_media_active & IFM_FDX) {
+	if (mii->mii_media_active & IFM_FDX) {
 		DPRINTF(WM_DEBUG_LINK,
 		("%s: LINK: statchg: FDX\n", ifp->if_xname));
 		sc->sc_tctl |= TCTL_COLD(TX_COLLISION_DISTANCE_FDX);
@@ -11195,7 +11199,7 @@ wm_gmii_statchg(struct ifnet *ifp)
 	CSR_WRITE(sc, (sc->sc_type < WM_T_82543) ? WMREG_OLD_FCRTL
 		 : WMREG_FCRTL, sc->sc_fcrtl);
 	if (sc->sc_type == WM_T_80003) {
-		switch (IFM_SUBTYPE(sc->sc_mii.mii_media_active)) {
+		switch (IFM_SUBTYPE(mii->mii_media_active)) {
 		case IFM_1000_T:
 			wm_kmrn_writereg(sc, KUMCTRLSTA_OFFSET_HD_CTRL,
 			KUMCTRLSTA_HD_CTRL_1000_DEFAULT);
@@ -11784,7 +11788,8 @@ wm_tbi_tick(struct wm_softc *sc)
 		if ((IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO)
 		&& (++sc->sc_tbi_serdes_ticks
 			>= sc->sc_tbi_serdes_anegticks)) {
-			DPRINTF(WM_DEBUG_LINK, ("EXPIRE\n"));
+			DPRINTF(WM_DEBUG_LINK, ("%s: %s: EXPIRE\n",
+device_xname(sc->sc_dev), __func__));
 			sc->sc_tbi_serdes_ticks = 0;
 			/*
 			 * Reset the link, and let autonegotiation do
@@ -11891,7 +11896,7 @@ wm_serdes_mediastatus(struct ifnet *ifp,
 {
 	struct wm_softc *sc = ifp->if_softc;
 	struct mii_data *mii = &sc->sc_mii;
-	struct ifmedia_entr

CVS commit: [netbsd-9] src/sys/netinet

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 18:57:02 UTC 2020

Modified Files:
src/sys/netinet [netbsd-9]: if_arp.c

Log Message:
Pull up following revision(s) (requested by roy in ticket #645):

sys/netinet/if_arp.c: revision 1.292

arp: find source address then target address when processing input

This fixes the case where another host having a duplicate ip address
starts using it right away without probing for it's availability.

While here, prefer ifatoia over a strict cast.


To generate a diff of this commit:
cvs rdiff -u -r1.282.2.5 -r1.282.2.6 src/sys/netinet/if_arp.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/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.282.2.5 src/sys/netinet/if_arp.c:1.282.2.6
--- src/sys/netinet/if_arp.c:1.282.2.5	Fri Oct 11 18:22:14 2019
+++ src/sys/netinet/if_arp.c	Fri Jan 24 18:57:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.282.2.5 2019/10/11 18:22:14 martin Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.282.2.6 2020/01/24 18:57:02 martin Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.282.2.5 2019/10/11 18:22:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.282.2.6 2020/01/24 18:57:02 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -1025,7 +1025,7 @@ in_arpinput(struct mbuf *m)
 	struct psref psref, psref_ia;
 	int s;
 	char ipbuf[INET_ADDRSTRLEN];
-	bool do_dad;
+	bool find_source, do_dad;
 
 	if (__predict_false(m_makewritable(&m, 0, m->m_pkthdr.len, M_DONTWAIT)))
 		goto out;
@@ -1060,11 +1060,20 @@ in_arpinput(struct mbuf *m)
 	 * or any address on the interface to use
 	 * as a dummy address in the rest of this function.
 	 *
-	 * If the target IP address is zero then try and find
-	 * the sender address for DAD.
+	 * First try and find the source address for early
+	 * duplicate address detection.
 	 */
-	myaddr = in_nullhost(itaddr) ? isaddr : itaddr;
+	if (in_nullhost(isaddr)) {
+		if (in_nullhost(itaddr)) /* very bogus ARP */
+			goto out;
+		find_source = false;
+		myaddr = itaddr;
+	} else {
+		find_source = true;
+		myaddr = isaddr;
+	}
 	s = pserialize_read_enter();
+again:
 	IN_ADDRHASH_READER_FOREACH(ia, myaddr.s_addr) {
 		if (!in_hosteq(ia->ia_addr.sin_addr, myaddr))
 			continue;
@@ -1106,6 +1115,15 @@ in_arpinput(struct mbuf *m)
 		ifp = bridge_ia->ia_ifp;
 	}
 #endif
+
+	/* If we failed to find the source address then find
+	 * the target address. */
+	if (ia == NULL && find_source && !in_nullhost(itaddr)) {
+		find_source = false;
+		myaddr = itaddr;
+		goto again;
+	}
+
 	if (ia != NULL)
 		ia4_acquire(ia, &psref_ia);
 	pserialize_read_exit(s);
@@ -1787,7 +1805,7 @@ done:
 static void
 arp_dad_duplicated(struct ifaddr *ifa, const struct sockaddr_dl *from)
 {
-	struct in_ifaddr *ia = (struct in_ifaddr *)ifa;
+	struct in_ifaddr *ia = ifatoia(ifa);
 	struct ifnet *ifp = ifa->ifa_ifp;
 	char ipbuf[INET_ADDRSTRLEN], llabuf[LLA_ADDRSTRLEN];
 	const char *iastr, *llastr;



CVS commit: src/sys/kern

2020-01-24 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Fri Jan 24 20:05:15 UTC 2020

Modified Files:
src/sys/kern: kern_lock.c kern_synch.c

Log Message:
Carefully put kernel_lock back the way it was, and add a comment hinting
that changing it is not a good idea, and hopefully nobody will ever try to
change it ever again.


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/kern/kern_lock.c
cvs rdiff -u -r1.337 -r1.338 src/sys/kern/kern_synch.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_lock.c
diff -u src/sys/kern/kern_lock.c:1.166 src/sys/kern/kern_lock.c:1.167
--- src/sys/kern/kern_lock.c:1.166	Wed Jan 22 13:19:33 2020
+++ src/sys/kern/kern_lock.c	Fri Jan 24 20:05:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_lock.c,v 1.166 2020/01/22 13:19:33 ad Exp $	*/
+/*	$NetBSD: kern_lock.c,v 1.167 2020/01/24 20:05:15 ad Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.166 2020/01/22 13:19:33 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.167 2020/01/24 20:05:15 ad Exp $");
 
 #include 
 #include 
@@ -156,6 +156,11 @@ _kernel_lock_dump(const volatile void *j
 
 /*
  * Acquire 'nlocks' holds on the kernel lock.
+ *
+ * Although it may not look it, this is one of the most central, intricate
+ * routines in the kernel, and tons of code elsewhere depends on its exact
+ * behaviour.  If you change something in here, expect it to bite you in the
+ * rear.
  */
 void
 _kernel_lock(int nlocks)
@@ -164,7 +169,6 @@ _kernel_lock(int nlocks)
 	LOCKSTAT_TIMER(spintime);
 	LOCKSTAT_FLAG(lsflag);
 	struct lwp *owant;
-	u_int count;
 #ifdef LOCKDEBUG
 	u_int spins = 0;
 #endif
@@ -210,16 +214,15 @@ _kernel_lock(int nlocks)
 	 */
 	membar_producer();
 	owant = ci->ci_biglock_wanted;
+	ci->ci_biglock_wanted = l;
 
 	/*
-	 * Stay pinned to the CPU and spin until we acquire the lock.  Once
-	 * we have it, record the time spent with lockstat.
+	 * Spin until we acquire the lock.  Once we have it, record the
+	 * time spent with lockstat.
 	 */
-	l->l_nopreempt++;
 	LOCKSTAT_ENTER(lsflag);
 	LOCKSTAT_START_TIMER(lsflag, spintime);
 
-	count = SPINLOCK_BACKOFF_MIN;
 	do {
 		splx(s);
 		while (__SIMPLELOCK_LOCKED_P(kernel_lock)) {
@@ -230,24 +233,12 @@ _kernel_lock(int nlocks)
 	_KERNEL_LOCK_ABORT("spinout");
 			}
 #endif
-			SPINLOCK_BACKOFF(count);
-			if (count == SPINLOCK_BACKOFF_MAX) {
-/* Ok, waiting for real. */
-ci->ci_biglock_wanted = l;
-			}
 		}
 		s = splvm();
 	} while (!__cpu_simple_lock_try(kernel_lock));
 
-	/*
-	 * Got it; not re-enable preemption, although we now can't do a
-	 * preemption as kernel_lock is held!
-	 */
-	l->l_nopreempt--;
 	ci->ci_biglock_count = nlocks;
 	l->l_blcnt = nlocks;
-	splx(s);
-
 	LOCKSTAT_STOP_TIMER(lsflag, spintime);
 	LOCKDEBUG_LOCKED(kernel_lock_dodebug, kernel_lock, NULL,
 	RETURN_ADDRESS, 0);
@@ -256,6 +247,7 @@ _kernel_lock(int nlocks)
 		LB_KERNEL_LOCK | LB_SPIN, 1, spintime, RETURN_ADDRESS);
 	}
 	LOCKSTAT_EXIT(lsflag);
+	splx(s);
 
 	/*
 	 * Now that we have kernel_lock, reset ci_biglock_wanted.  This

Index: src/sys/kern/kern_synch.c
diff -u src/sys/kern/kern_synch.c:1.337 src/sys/kern/kern_synch.c:1.338
--- src/sys/kern/kern_synch.c:1.337	Wed Jan 22 13:19:33 2020
+++ src/sys/kern/kern_synch.c	Fri Jan 24 20:05:15 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_synch.c,v 1.337 2020/01/22 13:19:33 ad Exp $	*/
+/*	$NetBSD: kern_synch.c,v 1.338 2020/01/24 20:05:15 ad Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019
@@ -69,7 +69,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.337 2020/01/22 13:19:33 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.338 2020/01/24 20:05:15 ad Exp $");
 
 #include "opt_kstack.h"
 #include "opt_dtrace.h"
@@ -353,7 +353,8 @@ kpreempt(uintptr_t where)
 			break;
 		}
 		s = splsched();
-		if (__predict_false(l->l_blcnt != 0)) {
+		if (__predict_false(l->l_blcnt != 0 ||
+		curcpu()->ci_biglock_wanted != NULL)) {
 			/* Hold or want kernel_lock, code is not MT safe. */
 			splx(s);
 			if ((dop & DOPREEMPT_COUNTED) == 0) {



CVS commit: [netbsd-8] src/doc

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 18:50:19 UTC 2020

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

Log Message:
Tickets #1490 - #1492


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.90 -r1.1.2.91 src/doc/CHANGES-8.2

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.2
diff -u src/doc/CHANGES-8.2:1.1.2.90 src/doc/CHANGES-8.2:1.1.2.91
--- src/doc/CHANGES-8.2:1.1.2.90	Thu Jan 23 10:32:38 2020
+++ src/doc/CHANGES-8.2	Fri Jan 24 18:50:19 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.90 2020/01/23 10:32:38 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.91 2020/01/24 18:50:19 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1916,3 +1916,47 @@ sys/netinet/ip_encap.c1.72
 	Fix PR security/54881: fix bogus psref_release().
 	[knakahara, ticket #1489]
 
+sys/dev/pci/ixgbe/if_bypass.c		1.5
+sys/dev/pci/ixgbe/ixgbe_osdep.c		1.5
+sys/dev/pci/ixgbe/ix_txrx.c		1.58-1.60
+sys/dev/pci/ixgbe/ixgbe.c		1.195,1.220-1.221 via patch
+sys/dev/pci/ixgbe/ixgbe.h		1.60-1.2
+sys/dev/pci/ixgbe/ixgbe_api.c		1.24
+sys/dev/pci/ixgbe/ixgbe_common.c	1.26
+sys/dev/pci/ixgbe/ixgbe_netbsd.c	1.11-1.12
+sys/dev/pci/ixgbe/ixgbe_osdep.h		1.24
+sys/dev/pci/ixgbe/ixgbe_phy.c		1.19
+sys/dev/pci/ixgbe/ixgbe_82598.c		1.14
+sys/dev/pci/ixgbe/ixv.c			1.122,1.142,1.144 via patch
+
+	- Use unsigned to avoid undefined behavior in
+	  ix{gbe,v}_[un]register_vlan().
+	- Free RX structure correctly when detaching.
+	- Remove unused code.
+	- Remove extra spaces.
+	- Fix some typos in comment.
+	- KNF.
+	[msaitoh, ticket #1490]
+
+sys/dev/mii/ihphy.c1.15
+
+	Remove extra 10ms delay in ihphy_reset() to reduce the
+	possibility of packet drop.
+	[msaitoh, ticket #1491]
+
+sys/dev/pci/if_wm.c			1.650, 1.652-1.654 via patch
+sys/dev/pci/if_wmreg.h			1.116-1.117
+
+	- Set CTRL_ILOS(Invert loss of signal) bit correctly on 82580
+	  port 1, 2, 3 and newer chips. This change fixes a bug that some
+	  fiber, serdes or SFP devices don't detect the link status correctly.
+	- Simplify code by using "struct mii_data *mii" more. No functional
+	  change.
+	- MSI-X doesn't use sc->sc_icr variable, so move the code into
+	  non-MSI-X part. No functional change intended.
+	- Modify debug printfs a bit.
+	- Rename macro.
+	- Use __BIT()
+	- Fix comment. Add comment.
+	- KNF.
+	[msaitoh, ticket #1492]



CVS commit: src/sys/arch/amd64/conf

2020-01-24 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Fri Jan 24 18:58:46 UTC 2020

Modified Files:
src/sys/arch/amd64/conf: GENERIC

Log Message:
Set AUDIO_BLK_MS=4 - unlikely to cause significant overhead on non-m68k.

Several of us have been setting this in /etc/sysctl.conf for months, to
get better performance from applications that require synced audio, etc.

It's also mentioned as a good value with low overhead on most archs here:
https://mail-index.netbsd.org/tech-kern/2019/12/07/msg025830.html

We could probably go lower, but this is low enough to make most/all
software run well, removing frame drops. It's also low enough to get
emulators/mednafen to stop complaining in the console.


To generate a diff of this commit:
cvs rdiff -u -r1.558 -r1.559 src/sys/arch/amd64/conf/GENERIC

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/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.558 src/sys/arch/amd64/conf/GENERIC:1.559
--- src/sys/arch/amd64/conf/GENERIC:1.558	Mon Jan 20 18:38:19 2020
+++ src/sys/arch/amd64/conf/GENERIC	Fri Jan 24 18:58:46 2020
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.558 2020/01/20 18:38:19 thorpej Exp $
+# $NetBSD: GENERIC,v 1.559 2020/01/24 18:58:46 nia Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/amd64/conf/std.amd64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.558 $"
+#ident		"GENERIC-$Revision: 1.559 $"
 
 maxusers	64		# estimated number of users
 
@@ -55,6 +55,9 @@ maxusers	64		# estimated number of users
 
 options 	INSECURE	# disable kernel security levels - X needs this
 
+options		AUDIO_BLK_MS=4	# make software with low latency needs performant
+# no substantial CPU overhead on this platform
+
 options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
 options 	NTP		# NTP phase/frequency locked loop
 



CVS commit: [netbsd-9] src/doc

2020-01-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Jan 24 20:21:53 UTC 2020

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #645 and #646


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.164 -r1.1.2.165 src/doc/CHANGES-9.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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.164 src/doc/CHANGES-9.0:1.1.2.165
--- src/doc/CHANGES-9.0:1.1.2.164	Thu Jan 23 10:15:40 2020
+++ src/doc/CHANGES-9.0	Fri Jan 24 20:21:53 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.164 2020/01/23 10:15:40 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.165 2020/01/24 20:21:53 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7875,3 +7875,14 @@ sys/netinet/ip_encap.c1.72
 	PR security/54881: fix bogus psref_release().
 	[knakahara, ticket #644]
 
+sys/netinet/if_arp.c1.292
+
+	Fix ARA duplicate address defending.
+	[roy, ticket #645]
+
+sbin/route/route.c1.164,1.165
+
+	route(8): decode the correct flags for interface address messages
+	and show them instead of interface flags.
+	[roy, ticket #646]
+



CVS commit: src/usr.bin/vndcompress

2020-01-24 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan 24 20:20:35 UTC 2020

Modified Files:
src/usr.bin/vndcompress: vndcompress.1

Log Message:
Since vnconfig(8) was renamed (many years ago), update some cross-refs
in vndcompress(1) man page.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/vndcompress/vndcompress.1

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

Modified files:

Index: src/usr.bin/vndcompress/vndcompress.1
diff -u src/usr.bin/vndcompress/vndcompress.1:1.14 src/usr.bin/vndcompress/vndcompress.1:1.15
--- src/usr.bin/vndcompress/vndcompress.1:1.14	Wed Jan 22 06:18:17 2014
+++ src/usr.bin/vndcompress/vndcompress.1	Fri Jan 24 20:20:35 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: vndcompress.1,v 1.14 2014/01/22 06:18:17 riastradh Exp $
+.\"	$NetBSD: vndcompress.1,v 1.15 2020/01/24 20:20:35 pgoyette Exp $
 .\"
 .\" Copyright (c) 2013 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 21, 2014
+.Dd January 24, 2020
 .Dt VNDCOMPRESS 1
 .Os
 .Sh NAME
@@ -59,7 +59,7 @@ utility compresses disk images in cloop2
 device can interpret as read-only disk devices using the
 .Fl z
 option to
-.Xr vnconfig 8 .
+.Xr vndconfig 8 .
 .Pp
 By default,
 .Nm vndcompress
@@ -203,7 +203,7 @@ assuming your kernel was built with the
 .Dv VND_COMPRESSION
 option enabled:
 .Bd -literal -offset indent
-# vnconfig -z vnd0 disk.cloop2
+# vndconfig -z vnd0 disk.cloop2
 # mount /dev/vnd0d /mnt
 .Ed
 .Sh SIGNALS
@@ -246,7 +246,7 @@ may be truncated if the uncompressed ima
 the compression block size.
 .Sh SEE ALSO
 .Xr vnd 4 ,
-.Xr vnconfig 8
+.Xr vndconfig 8
 .Sh HISTORY
 The
 .Nm



CVS commit: src/distrib/sets/lists/xcomp

2020-01-24 Thread Yuuki Enomoto
Module Name:src
Committed By:   uki
Date:   Sat Jan 25 00:12:42 UTC 2020

Modified Files:
src/distrib/sets/lists/xcomp: mi

Log Message:
Fix incorrect package name, lacked category prefix.


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/distrib/sets/lists/xcomp/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/xcomp/mi
diff -u src/distrib/sets/lists/xcomp/mi:1.214 src/distrib/sets/lists/xcomp/mi:1.215
--- src/distrib/sets/lists/xcomp/mi:1.214	Tue Nov 12 10:14:11 2019
+++ src/distrib/sets/lists/xcomp/mi	Sat Jan 25 00:12:42 2020
@@ -1,4 +1,4 @@
-#	 $NetBSD: mi,v 1.214 2019/11/12 10:14:11 uki Exp $
+#	 $NetBSD: mi,v 1.215 2020/01/25 00:12:42 uki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2727,15 +2727,15 @@
 ./usr/X11R7/man/html3/XExposeEvent.html			xcomp-libX11-htmlman	html,xorg
 ./usr/X11R7/man/html3/XExtentsOfFontSet.html		xcomp-libX11-htmlman	html,xorg
 ./usr/X11R7/man/html3/XF86DGA.html			xcomp-libXxf86dga-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86Misc.html			libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscGetKbdSettings.html	libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscGetMouseSettings.html	libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscGetSaver.html		libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscQueryExtension.html	libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscQueryVersion.html		libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscSetKbdSettings.html	libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscSetMouseSettings.html	libXxf86misc-htmlman	html,xorg
-./usr/X11R7/man/html3/XF86MiscSetSaver.html		libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86Misc.html			xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscGetKbdSettings.html	xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscGetMouseSettings.html	xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscGetSaver.html		xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscQueryExtension.html	xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscQueryVersion.html		xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscSetKbdSettings.html	xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscSetMouseSettings.html	xcomp-libXxf86misc-htmlman	html,xorg
+./usr/X11R7/man/html3/XF86MiscSetSaver.html		xcomp-libXxf86misc-htmlman	html,xorg
 ./usr/X11R7/man/html3/XF86VM.html			libXxf86vm-htmlman	html,xorg
 ./usr/X11R7/man/html3/XF86VidModeDeleteModeLine.html	libXxf86vm-htmlman	html,xorg
 ./usr/X11R7/man/html3/XF86VidModeGetAllModeLines.html	libXxf86vm-htmlman	html,xorg



CVS commit: src/usr.bin/vmstat

2020-01-24 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sat Jan 25 05:43:32 UTC 2020

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
Fix alignment of Flags column for vmstat -mW.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/vmstat/vmstat.c

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

Modified files:

Index: src/usr.bin/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.235 src/usr.bin/vmstat/vmstat.c:1.236
--- src/usr.bin/vmstat/vmstat.c:1.235	Wed Jan 15 17:56:46 2020
+++ src/usr.bin/vmstat/vmstat.c	Sat Jan 25 05:43:32 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.235 2020/01/15 17:56:46 ad Exp $ */
+/* $NetBSD: vmstat.c,v 1.236 2020/01/25 05:43:32 simonb Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = "@(#)vmstat.c	8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.235 2020/01/15 17:56:46 ad Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.236 2020/01/25 05:43:32 simonb Exp $");
 #endif
 #endif /* not lint */
 
@@ -1492,7 +1492,7 @@ dopool_sysctl(int verbose, int wide)
 	"Minpg",
 	wide ? 7 : 6, "Maxpg",
 	"Idle",
-	wide ? "  Flags" : "",
+	wide ? "   Flags" : "",
 	wide ? "   Util" : "");
 
 	name_len = MIN((int)sizeof(pp->pr_wchan), wide ? 16 : 11);
@@ -1533,7 +1533,7 @@ dopool_sysctl(int verbose, int wide)
 		PRWORD(ovflw, " %*s", wide ? 7 : 6, 1, maxp);
 		PRWORD(ovflw, " %*" PRIu64, 5, 1, pp->pr_nidle);
 		if (wide)
-			PRWORD(ovflw, " 0x%0*" PRIx64, 5, 1,
+			PRWORD(ovflw, " 0x%0*" PRIx64, 6, 1,
 			pp->pr_flags);
 
 		this_inuse = pp->pr_nout * pp->pr_size;
@@ -1640,7 +1640,7 @@ dopool(int verbose, int wide)
 			"Minpg",
 			wide ? 7 : 6, "Maxpg",
 			"Idle",
-			wide ? "  Flags" : "",
+			wide ? "   Flags" : "",
 			wide ? "   Util" : "");
 			first = 0;
 		}
@@ -1679,7 +1679,7 @@ dopool(int verbose, int wide)
 		PRWORD(ovflw, " %*s", wide ? 7 : 6, 1, maxp);
 		PRWORD(ovflw, " %*lu", 5, 1, pp->pr_nidle);
 		if (wide)
-			PRWORD(ovflw, " 0x%0*x", 5, 1,
+			PRWORD(ovflw, " 0x%0*x", 6, 1,
 			pp->pr_flags | pp->pr_roflags);
 
 		this_inuse = pp->pr_nout * pp->pr_size;



CVS commit: src/sys/dev/pci

2020-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 25 07:57:48 UTC 2020

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

Log Message:
Found by kUBSan:

- Use unsigned to avoid undefined behavior in aq_hw_init().
- Cast to unsigned to avoid undefined behavior in aq_set_mac_addr().


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/pci/if_aq.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_aq.c
diff -u src/sys/dev/pci/if_aq.c:1.4 src/sys/dev/pci/if_aq.c:1.5
--- src/sys/dev/pci/if_aq.c:1.4	Fri Jan 17 05:22:42 2020
+++ src/sys/dev/pci/if_aq.c	Sat Jan 25 07:57:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aq.c,v 1.4 2020/01/17 05:22:42 ryo Exp $	*/
+/*	$NetBSD: if_aq.c,v 1.5 2020/01/25 07:57:48 msaitoh Exp $	*/
 
 /**
  * aQuantia Corporation Network Driver
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.4 2020/01/17 05:22:42 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.5 2020/01/25 07:57:48 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_if_aq.h"
@@ -209,7 +209,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_aq.c,v 1.
 
 /* AQ_GEN_INTR_MAP_REG[AQ_RINGS_NUM] 0x2180-0x2200 */
 #define AQ_GEN_INTR_MAP_REG(i)			(0x2180 + (i) * 4)
-#define  AQ_B0_ERR_INT8
+#define  AQ_B0_ERR_INT8U
 
 #define AQ_INTR_CTRL_REG			0x2300
 #define  AQ_INTR_CTRL_IRQMODE			__BITS(1,0)
@@ -2581,7 +2581,7 @@ aq_set_mac_addr(struct aq_softc *sc, int
 	}
 
 	h = (enaddr[0] <<  8) | (enaddr[1]);
-	l = (enaddr[2] << 24) | (enaddr[3] << 16) |
+	l = ((uint32_t)enaddr[2] << 24) | (enaddr[3] << 16) |
 	(enaddr[4] <<  8) | (enaddr[5]);
 
 	/* disable, set, and enable */
@@ -3281,7 +3281,7 @@ aq_hw_init(struct aq_softc *sc)
 	AQ_WRITE_REG(sc, AQ_INTR_AUTOMASK_REG, 0x);
 
 	AQ_WRITE_REG(sc, AQ_GEN_INTR_MAP_REG(0),
-	((AQ_B0_ERR_INT << 24) | (1 << 31)) |
+	((AQ_B0_ERR_INT << 24) | (1U << 31)) |
 	((AQ_B0_ERR_INT << 16) | (1 << 23))
 	);
 



CVS commit: src/sys/dev/pci

2020-01-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Jan 25 07:59:15 UTC 2020

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

Log Message:
- Print Bridge Config Retry Enable bit and Retimer Presence Detect Supported
  bit.
- Avoid using magic number.


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/dev/pci/pci_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/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.219 src/sys/dev/pci/pci_subr.c:1.220
--- src/sys/dev/pci/pci_subr.c:1.219	Fri Jan 17 02:08:25 2020
+++ src/sys/dev/pci/pci_subr.c	Sat Jan 25 07:59:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.219 2020/01/17 02:08:25 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.220 2020/01/25 07:59:14 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.219 2020/01/17 02:08:25 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.220 2020/01/25 07:59:14 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1869,6 +1869,9 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	onoff("Enable No Snoop", reg, PCIE_DCSR_ENA_NO_SNOOP);
 	printf("  Max Read Request Size: %d byte\n",
 	128 << __SHIFTOUT(reg, PCIE_DCSR_MAX_READ_REQ));
+	if (pcie_devtype == PCIE_XCAP_TYPE_PCIE2PCI)
+		onoff("Bridge Config Retry Enable", reg,
+		PCIE_DCSR_BRDG_CFG_RETRY);
 
 	/* Device Status Register */
 	reg = regs[o2i(capoff + PCIE_DCSR)];
@@ -2254,6 +2257,8 @@ pci_conf_print_pcie_cap(const pcireg_t *
 			pci_print_pcie_linkspeedvector(
 __SHIFTOUT(reg, PCIE_LCAP2_LOWSKPOS_RECSUPPSV));
 			printf("\n");
+			onoff("Retimer Presence Detect Supported", reg,
+			PCIE_LCAP2_RETIMERPD);
 			onoff("DRS Supported", reg, PCIE_LCAP2_DRS);
 			drs_supported = (reg & PCIE_LCAP2_DRS) ? true : false;
 		}
@@ -2273,7 +2278,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 			__SHIFTOUT(reg, PCIE_LCSR2_SEL_DEEMP));
 		printf("\n");
 		printf("  Transmit Margin: %u\n",
-		(unsigned int)(reg & PCIE_LCSR2_TX_MARGIN) >> 7);
+		(unsigned int)__SHIFTOUT(reg,  PCIE_LCSR2_TX_MARGIN));
 		onoff("Enter Modified Compliance", reg, PCIE_LCSR2_EN_MCOMP);
 		onoff("Compliance SOS", reg, PCIE_LCSR2_COMP_SOS);
 		printf("  Compliance Present/De-emphasis: ");