CVS commit: src/sys/dev/audio

2019-09-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep  6 06:44:45 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Tune some debug message level.
These messages are important for debugging hardware driver.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/audio/audio.c

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



CVS commit: src/sys/dev/audio

2019-09-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Sep  6 06:44:45 UTC 2019

Modified Files:
src/sys/dev/audio: audio.c

Log Message:
Tune some debug message level.
These messages are important for debugging hardware driver.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/audio/audio.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/audio/audio.c
diff -u src/sys/dev/audio/audio.c:1.30 src/sys/dev/audio/audio.c:1.31
--- src/sys/dev/audio/audio.c:1.30	Thu Aug 29 13:01:07 2019
+++ src/sys/dev/audio/audio.c	Fri Sep  6 06:44:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: audio.c,v 1.30 2019/08/29 13:01:07 isaki Exp $	*/
+/*	$NetBSD: audio.c,v 1.31 2019/09/06 06:44:45 isaki Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -142,7 +142,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.30 2019/08/29 13:01:07 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.31 2019/09/06 06:44:45 isaki Exp $");
 
 #ifdef _KERNEL_OPT
 #include "audio.h"
@@ -4621,7 +4621,7 @@ audio_mixer_init(struct audio_softc *sc,
 		audio_params_t p = format2_to_params(&mixer->hwbuf.fmt);
 		rounded = sc->hw_if->round_blocksize(sc->hw_hdl, blksize,
 		mode, &p);
-		TRACE(2, "round_blocksize %d -> %d", blksize, rounded);
+		TRACE(1, "round_blocksize %d -> %d", blksize, rounded);
 		if (rounded != blksize) {
 			if ((rounded * NBBY) % (mixer->hwbuf.fmt.stride *
 			mixer->hwbuf.fmt.channels) != 0) {
@@ -4646,7 +4646,7 @@ audio_mixer_init(struct audio_softc *sc,
 		size_t rounded;
 		rounded = sc->hw_if->round_buffersize(sc->hw_hdl, mode,
 		bufsize);
-		TRACE(2, "round_buffersize %zd -> %zd", bufsize, rounded);
+		TRACE(1, "round_buffersize %zd -> %zd", bufsize, rounded);
 		if (rounded < bufsize) {
 			/* buffersize needs NBLKHW blocks at least. */
 			device_printf(sc->sc_dev,
@@ -4669,7 +4669,7 @@ audio_mixer_init(struct audio_softc *sc,
 			capacity = mixer->frames_per_block * hwblks;
 		}
 	}
-	TRACE(2, "buffersize for %s = %zu",
+	TRACE(1, "buffersize for %s = %zu",
 	(mode == AUMODE_PLAY) ? "playback" : "recording",
 	bufsize);
 	mixer->hwbuf.capacity = capacity;



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

2019-09-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Sep  5 23:42:27 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_rtc.c

Log Message:
Catch up with RTC-related DTS changes for the H3, H5, and A64 SoCs.

mujo AT SDF.ORG, and verified on Pinebook by Jun Ebihara.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_rtc.c

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



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

2019-09-05 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Sep  5 23:42:27 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_rtc.c

Log Message:
Catch up with RTC-related DTS changes for the H3, H5, and A64 SoCs.

mujo AT SDF.ORG, and verified on Pinebook by Jun Ebihara.

XXX pullup-9


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sunxi_rtc.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/sunxi/sunxi_rtc.c
diff -u src/sys/arch/arm/sunxi/sunxi_rtc.c:1.4 src/sys/arch/arm/sunxi/sunxi_rtc.c:1.5
--- src/sys/arch/arm/sunxi/sunxi_rtc.c:1.4	Mon Jul 16 23:11:47 2018
+++ src/sys/arch/arm/sunxi/sunxi_rtc.c	Thu Sep  5 23:42:26 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_rtc.c,v 1.4 2018/07/16 23:11:47 christos Exp $ */
+/* $NetBSD: sunxi_rtc.c,v 1.5 2019/09/05 23:42:26 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_rtc.c,v 1.4 2018/07/16 23:11:47 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_rtc.c,v 1.5 2019/09/05 23:42:26 thorpej Exp $");
 
 #include 
 #include 
@@ -130,6 +130,8 @@ static const struct of_compat_data compa
 	{ "allwinner,sun4i-a10-rtc",		(uintptr_t)&sun4i_rtc_config },
 	{ "allwinner,sun6i-a31-rtc",		(uintptr_t)&sun6i_rtc_config },
 	{ "allwinner,sun7i-a20-rtc",		(uintptr_t)&sun7i_rtc_config },
+	{ "allwinner,sun8i-h3-rtc",		(uintptr_t)&sun6i_rtc_config },
+	{ "allwinner,sun50i-h5-rtc",		(uintptr_t)&sun6i_rtc_config },
 	{ NULL }
 };
 



CVS commit: src/sys/sys

2019-09-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep  5 22:29:59 UTC 2019

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to 9.99.11

struct in6_addr ABI revert to the previous layout.


To generate a diff of this commit:
cvs rdiff -u -r1.610 -r1.611 src/sys/sys/param.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/param.h
diff -u src/sys/sys/param.h:1.610 src/sys/sys/param.h:1.611
--- src/sys/sys/param.h:1.610	Tue Aug 20 12:33:04 2019
+++ src/sys/sys/param.h	Thu Sep  5 22:29:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.610 2019/08/20 12:33:04 riastradh Exp $	*/
+/*	$NetBSD: param.h,v 1.611 2019/09/05 22:29:59 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999001000	/* NetBSD 9.99.10 */
+#define	__NetBSD_Version__	999001100	/* NetBSD 9.99.11 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2019-09-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep  5 22:29:59 UTC 2019

Modified Files:
src/sys/sys: param.h

Log Message:
Welcome to 9.99.11

struct in6_addr ABI revert to the previous layout.


To generate a diff of this commit:
cvs rdiff -u -r1.610 -r1.611 src/sys/sys/param.h

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



CVS commit: src/sys/dev/adb

2019-09-05 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Sep  5 21:29:22 UTC 2019

Modified Files:
src/sys/dev/adb: adb_ms.c

Log Message:
now that I figured out how the checksum for the Kensington Turbo Mouse's
init command works:
- document it
- calculate the checksum instead of hardcoding it, so the init command can be
  easily changed
- drop the first init string - it's entirely overwritten by the 2nd
- remove some debug goop


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/adb/adb_ms.c

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



CVS commit: src/sys/dev/adb

2019-09-05 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Sep  5 21:29:22 UTC 2019

Modified Files:
src/sys/dev/adb: adb_ms.c

Log Message:
now that I figured out how the checksum for the Kensington Turbo Mouse's
init command works:
- document it
- calculate the checksum instead of hardcoding it, so the init command can be
  easily changed
- drop the first init string - it's entirely overwritten by the 2nd
- remove some debug goop


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/adb/adb_ms.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/adb/adb_ms.c
diff -u src/sys/dev/adb/adb_ms.c:1.18 src/sys/dev/adb/adb_ms.c:1.19
--- src/sys/dev/adb/adb_ms.c:1.18	Sat Aug 31 02:14:51 2019
+++ src/sys/dev/adb/adb_ms.c	Thu Sep  5 21:29:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_ms.c,v 1.18 2019/08/31 02:14:51 macallan Exp $	*/
+/*	$NetBSD: adb_ms.c,v 1.19 2019/09/05 21:29:22 macallan Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adb_ms.c,v 1.18 2019/08/31 02:14:51 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_ms.c,v 1.19 2019/09/05 21:29:22 macallan Exp $");
 
 #include 
 #include 
@@ -320,6 +320,16 @@ adbms_init_uspeed(struct adbms_softc *sc
 	sc->sc_res = 200;
 }
 
+static int
+adbms_turbo_csum(uint8_t *d)
+{
+	int i = 0, sum = 0;
+
+	for (i = 0; i < 7; i++)
+		sum ^= d[i];
+	return (sum ^ 0xff);
+}
+
 static void
 adbms_init_turbo(struct adbms_softc *sc)
 {
@@ -343,22 +353,13 @@ adbms_init_turbo(struct adbms_softc *sc)
  - 0x21 - button 1 - 2, button 2 - 1
  - 0x31 - button 1 - 3, button 2 - 1
  * byte 4 programs a delay for button presses, apparently in 1/100 seconds
- * byte 7 is some sort of checksum, writes will only stick if it's valid
-  no idea how exactly it works yet, can't be too complicated considering
-  the device's age
+ * byte 7 is a simple XOR checksum, writes will only stick if it's valid
+  as in, b[7] = (b[0] ^ b[1] ^ ... ^ b[6]) ^ 0xff
  */
  
-/*
- * XXX
- * I doubt the first command is actually necessary. Leave in for now since it 
- * doesn't do any harm either
- */
-	static u_char data1[] =
-		{ 0xe7, 0x8c, 0, 0, 0, 0xff, 0xff, 0x94 };
-
 	/* this seems to be the most reasonable default */
-	static u_char data2[] =
-		{ 0xa5, 0x0e, 0, 0, 1, 0xff, 0xff, 0x55 };
+	static u_char data[] =
+		{ 0xa5, 0x0e, 0, 0, 1, 0xff, 0xff, 0/*0x55*/ };
 
 	addr = sc->sc_adbdev->current_addr;
 
@@ -374,23 +375,9 @@ adbms_init_turbo(struct adbms_softc *sc)
 #endif
 
 	adbms_send_sync(sc, ADBFLUSH(addr), 0, NULL);
-	adbms_send_sync(sc, ADBLISTEN(addr, 2), 8, data1);
-	adbms_send_sync(sc, ADBFLUSH(addr), 0, NULL);
-	adbms_send_sync(sc, ADBLISTEN(addr, 2), 8, data2);
+	data[7] = adbms_turbo_csum(data);
+	adbms_send_sync(sc, ADBLISTEN(addr, 2), 8, data);
 
-#ifdef ADBMS_BRUTEFORCE
-	sc->sc_buffer[1] = 0;
-	int y = 0;
-	while ((sc->sc_buffer[1] != data2[1]) && (y < 0x100)) {
-		data2[7] = y;
-		y++;
-		adbms_send_sync(sc, ADBFLUSH(addr), 0, NULL);
-		adbms_send_sync(sc, ADBLISTEN(addr, 2), 8, data2);
-		adbms_send_sync(sc, ADBFLUSH(addr), 0, NULL);
-		adbms_send_sync(sc, ADBTALK(addr, 2), 0, NULL);
-	}
-	printf("y %02x\n", data2[7]);	
-#endif
 
 #ifdef ADBMS_DEBUG
 	int i, reg;



CVS commit: src/sys/netinet6

2019-09-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep  5 20:17:27 UTC 2019

Modified Files:
src/sys/netinet6: in6.h

Log Message:
Revert regression introduced in in6.h r. 1.95


revision 1.95
date: 2019-05-28 05:56:46 +0200;  author: kamil;  state: Exp;  lines: +2 -2;  
commitid: YrUzDYl5zfcjiVoB;
Decorate struct in6_addr with the __packed attribute

This avoids undefined behavior when accessing misaligned pointers.

Detected by kUBSan.

Patch by Akul Pillai.


This change caused regression in at least qemu and addresses potential binary 
ABI breakage.

Fixes PR/54523 by 


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/netinet6/in6.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/netinet6/in6.h
diff -u src/sys/netinet6/in6.h:1.95 src/sys/netinet6/in6.h:1.96
--- src/sys/netinet6/in6.h:1.95	Tue May 28 03:56:46 2019
+++ src/sys/netinet6/in6.h	Thu Sep  5 20:17:27 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.h,v 1.95 2019/05/28 03:56:46 kamil Exp $	*/
+/*	$NetBSD: in6.h,v 1.96 2019/09/05 20:17:27 kamil Exp $	*/
 /*	$KAME: in6.h,v 1.83 2001/03/29 02:55:07 jinmei Exp $	*/
 
 /*
@@ -126,7 +126,7 @@ struct in6_addr {
 		__uint16_t  __u6_addr16[8];
 		uint32_t  __u6_addr32[4];
 	} __u6_addr;			/* 128-bit IP6 address */
-} __packed;
+};
 
 #define s6_addr   __u6_addr.__u6_addr8
 #ifdef _KERNEL	/* XXX nonstandard */



CVS commit: src/sys/netinet6

2019-09-05 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep  5 20:17:27 UTC 2019

Modified Files:
src/sys/netinet6: in6.h

Log Message:
Revert regression introduced in in6.h r. 1.95


revision 1.95
date: 2019-05-28 05:56:46 +0200;  author: kamil;  state: Exp;  lines: +2 -2;  
commitid: YrUzDYl5zfcjiVoB;
Decorate struct in6_addr with the __packed attribute

This avoids undefined behavior when accessing misaligned pointers.

Detected by kUBSan.

Patch by Akul Pillai.


This change caused regression in at least qemu and addresses potential binary 
ABI breakage.

Fixes PR/54523 by 


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

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



CVS commit: src/usr.bin/xlint/lint1

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 20:12:11 UTC 2019

Modified Files:
src/usr.bin/xlint/lint1: scan.l

Log Message:
Fix decorators for __thread, add _Thread_local

christos


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/scan.l

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/xlint/lint1/scan.l
diff -u src/usr.bin/xlint/lint1/scan.l:1.89 src/usr.bin/xlint/lint1/scan.l:1.90
--- src/usr.bin/xlint/lint1/scan.l:1.89	Mon Mar  4 12:45:16 2019
+++ src/usr.bin/xlint/lint1/scan.l	Thu Sep  5 16:12:11 2019
@@ -1,5 +1,5 @@
 %{
-/* $NetBSD: scan.l,v 1.89 2019/03/04 17:45:16 christos Exp $ */
+/* $NetBSD: scan.l,v 1.90 2019/09/05 20:12:11 christos Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -35,7 +35,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: scan.l,v 1.89 2019/03/04 17:45:16 christos Exp $");
+__RCSID("$NetBSD: scan.l,v 1.90 2019/09/05 20:12:11 christos Exp $");
 #endif
 
 #include 
@@ -209,11 +209,12 @@ static	struct	kwtab {
 	{ "__int128_t",	T_TYPE,		0,	INT128,	0,	  0,1,0,0,1 },
 	{ "__uint128_t",T_TYPE,		0,	UINT128,0,	  0,1,0,0,1 },
 #endif
-	{ "__thread",	T_QUAL,		0,	0,	THREAD,	  0,0,1,0,7 },
+	{ "__thread",	T_QUAL,		0,	0,	THREAD,	  0,0,1,0,1 },
 	{ "_Bool",	T_TYPE,		0,	BOOL,	0,	  0,1,0,0,1 },
 	{ "_Complex",	T_TYPE,		0,	COMPLEX,0,	  0,1,0,0,1 },
 	{ "_Generic",	T_GENERIC,	0,	0,	0,	  0,1,0,0,1 },
 	{ "_Noreturn",	T_NORETURN,	0,	0,	0,	  0,1,0,0,1 },
+	{ "_Thread_local",T_QUAL,	0,	0,	THREAD,	  0,1,0,0,1 },
 	{ "alias",	T_AT_ALIAS,	0,	0,	0,	  0,0,1,1,5 },
 	{ "aligned",	T_AT_ALIGNED,	0,	0,	0,	  0,0,1,1,5 },
 	{ "alignof",	T_ALIGNOF,	0,	0,	0,	  0,0,0,0,4 },



CVS commit: src/usr.bin/xlint/lint1

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 20:12:11 UTC 2019

Modified Files:
src/usr.bin/xlint/lint1: scan.l

Log Message:
Fix decorators for __thread, add _Thread_local

christos


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/scan.l

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



CVS commit: src/doc

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 19:34:14 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1645 -r1.1646 src/doc/3RDPARTY
cvs rdiff -u -r1.2578 -r1.2579 src/doc/CHANGES

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



CVS commit: src/doc

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 19:34:14 UTC 2019

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1645 -r1.1646 src/doc/3RDPARTY
cvs rdiff -u -r1.2578 -r1.2579 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/3RDPARTY
diff -u src/doc/3RDPARTY:1.1645 src/doc/3RDPARTY:1.1646
--- src/doc/3RDPARTY:1.1645	Wed Sep  4 09:30:52 2019
+++ src/doc/3RDPARTY	Thu Sep  5 15:34:14 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1645 2019/09/04 13:30:52 roy Exp $
+#	$NetBSD: 3RDPARTY,v 1.1646 2019/09/05 19:34:14 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -120,12 +120,12 @@ Notes:
 bc includes dc, both of which are in the NetBSD tree.
 
 Package:	bind [named and utils]
-Version:	9.14.1/MPL
-Current Vers:	9.14.1/MPL
+Version:	9.14.5/MPL
+Current Vers:	9.14.5/MPL
 Maintainer:	ISC
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/
-Date:		2019-04-27
+Date:		2019-09-05
 Mailing List:	https://lists.isc.org/mailman/listinfo/bind-announce
 Mailing List:	https://lists.isc.org/mailman/listinfo/bind-users
 Responsible:	christos

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2578 src/doc/CHANGES:1.2579
--- src/doc/CHANGES:1.2578	Wed Sep  4 09:30:52 2019
+++ src/doc/CHANGES	Thu Sep  5 15:34:14 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2578 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2579 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -37,3 +37,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		return EHOSTDOWN to match inet behaviour. [roy 20190901]
 	inet: Fix sending RTM_MISS for unresolvable addresses. [roy 20190901]
 	dhcpcd(8): Import dhcpcd-8.0.4 [roy 20190904]
+	bind: Import version 9.14.5. [christos 20190905]



CVS commit: src/distrib/sets/lists

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 19:37:46 UTC 2019

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

Log Message:
bump for bind


To generate a diff of this commit:
cvs rdiff -u -r1.868 -r1.869 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.226 -r1.227 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.



CVS commit: src/external/mpl/bind

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 19:33:01 UTC 2019

Modified Files:
src/external/mpl/bind/dist: Makefile.in config.h.in configure
src/external/mpl/bind/dist/bin/dig: dig.1 dig.c dighost.c
src/external/mpl/bind/dist/bin/named: bind9.xsl.h config.c fuzz.c
geoip.c named.conf.5 server.c statschannel.c zoneconf.c
src/external/mpl/bind/dist/bin/named/include/named: geoip.h globals.h
src/external/mpl/bind/dist/bin/named/unix: dlz_dlopen_driver.c
src/external/mpl/bind/dist/bin/named/win32: ntservice.c os.c
src/external/mpl/bind/dist/bin/pkcs11: pkcs11-keygen.c
src/external/mpl/bind/dist/bin/plugins: filter-.c
src/external/mpl/bind/dist/bin/rndc: rndc.8
src/external/mpl/bind/dist/bin/tests/system: feature-test.c
src/external/mpl/bind/dist/bin/tests/system/dlzexternal: driver.c
src/external/mpl/bind/dist/bin/tests/system/dyndb/driver: driver.c
src/external/mpl/bind/dist/bin/tools: dnstap-read.c mdig.c
src/external/mpl/bind/dist/contrib/dlz/modules/common: dlz_dbi.c
src/external/mpl/bind/dist/fuzz: dns_rdata_fromwire_text.c
src/external/mpl/bind/dist/lib/bind9: check.c
src/external/mpl/bind/dist/lib/dns: acl.c client.c dispatch.c dnstap.c
gen-unix.h gen.c geoip2.c master.c masterdump.c message.c name.c
openssleddsa_link.c rbtdb.c rdata.c resolver.c rpz.c stats.c
update.c view.c zone.c
src/external/mpl/bind/dist/lib/dns/include/dns: acl.h clientinfo.h
ecs.h geoip.h message.h resolver.h rpz.h stats.h types.h view.h
zone.h
src/external/mpl/bind/dist/lib/dns/rdata/generic: ds_43.c key_25.c
opt_41.c sshfp_44.c
src/external/mpl/bind/dist/lib/dns/tests: acl_test.c db_test.c
dbdiff_test.c dbiterator_test.c dbversion_test.c dh_test.c
dispatch_test.c dnstap_test.c dnstest.c dst_test.c geoip_test.c
keytable_test.c master_test.c name_test.c nsec3_test.c peer_test.c
private_test.c rbt_serialize_test.c rbt_test.c rdata_test.c
rdataset_test.c rdatasetstats_test.c resolver_test.c result_test.c
rsa_test.c sigs_test.c time_test.c tkey_test.c tsig_test.c
update_test.c zonemgr_test.c zt_test.c
src/external/mpl/bind/dist/lib/irs/tests: resconf_test.c
src/external/mpl/bind/dist/lib/isc: hash.c ht.c mem.c rwlock.c
siphash.c sockaddr.c stats.c task.c
src/external/mpl/bind/dist/lib/isc/include/isc: endian.h hash.h
siphash.h util.h
src/external/mpl/bind/dist/lib/isc/tests: aes_test.c buffer_test.c
counter_test.c crc64_test.c errno_test.c hash_test.c heap_test.c
hmac_test.c ht_test.c lex_test.c mem_test.c netaddr_test.c
parse_test.c pool_test.c queue_test.c radix_test.c random_test.c
regex_test.c result_test.c safe_test.c siphash_test.c
sockaddr_test.c socket_test.c symtab_test.c task_test.c
taskpool_test.c time_test.c timer_test.c
src/external/mpl/bind/dist/lib/isc/unix: socket.c
src/external/mpl/bind/dist/lib/isccc/tests: result_test.c
src/external/mpl/bind/dist/lib/isccfg: aclconf.c namedconf.c parser.c
src/external/mpl/bind/dist/lib/isccfg/include/isccfg: aclconf.h
src/external/mpl/bind/dist/lib/isccfg/tests: parser_test.c
src/external/mpl/bind/dist/lib/ns: client.c interfacemgr.c query.c
xfrout.c
src/external/mpl/bind/dist/lib/ns/include/ns: client.h interfacemgr.h
types.h
src/external/mpl/bind/dist/lib/ns/tests: listenlist_test.c
notify_test.c plugin_test.c query_test.c
src/external/mpl/bind/include: config.h
src/external/mpl/bind/include/dns: code.h enumtype.h rdatastruct.h
src/external/mpl/bind/lib/libbind9: shlib_version
src/external/mpl/bind/lib/libdns: shlib_version
src/external/mpl/bind/lib/libirs: shlib_version
src/external/mpl/bind/lib/libisc: Makefile shlib_version
src/external/mpl/bind/lib/libisccc: shlib_version
src/external/mpl/bind/lib/libisccfg: shlib_version
src/external/mpl/bind/lib/libns: shlib_version
Removed Files:
src/external/mpl/bind/dist/bin/tests/system/wildcard/ns2: hints
src/external/mpl/bind/dist/bin/tests/system/wildcard/ns3: hints
src/external/mpl/bind/dist/bin/tests/system/wildcard/ns5: hints
src/external/mpl/bind/dist/lib/dns/rdata/generic: unspec_103.c
unspec_103.h

Log Message:
Merge conflicts and fix the build.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/mpl/bind/dist/Makefile.in
cvs rdiff -u -r1.5 -r1.6 src/external/mpl/bind/dist/config.h.in \
src/external/mpl/bind/dist/configure
cvs rdiff -u -r1.4 -r1.5 src/external/mpl/bind/dist/bin/dig/dig.1 \
src/external/mpl/

CVS commit: src/distrib/sets/lists

2019-09-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep  5 19:37:46 UTC 2019

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

Log Message:
bump for bind


To generate a diff of this commit:
cvs rdiff -u -r1.868 -r1.869 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.226 -r1.227 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.868 src/distrib/sets/lists/base/shl.mi:1.869
--- src/distrib/sets/lists/base/shl.mi:1.868	Fri Aug 23 04:17:27 2019
+++ src/distrib/sets/lists/base/shl.mi	Thu Sep  5 15:37:46 2019
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.868 2019/08/23 08:17:27 mrg Exp $
+# $NetBSD: shl.mi,v 1.869 2019/09/05 19:37:46 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -199,8 +199,8 @@
 ./usr/lib/libbfd.so.16base-sys-shlib		compatfile,binutils=231
 ./usr/lib/libbfd.so.16.0			base-sys-shlib		compatfile,binutils=231
 ./usr/lib/libbind9.sobase-bind-shlib		compatfile
-./usr/lib/libbind9.so.12base-bind-shlib		compatfile
-./usr/lib/libbind9.so.12.0			base-bind-shlib		compatfile
+./usr/lib/libbind9.so.13base-bind-shlib		compatfile
+./usr/lib/libbind9.so.13.0			base-bind-shlib		compatfile
 ./usr/lib/libblacklist.so			base-sys-shlib		compatfile
 ./usr/lib/libblacklist.so.0			base-sys-shlib		compatfile
 ./usr/lib/libblacklist.so.0.0			base-sys-shlib		compatfile
@@ -334,17 +334,17 @@
 ./usr/lib/libipsec.so.3base-net-shlib		compatfile
 ./usr/lib/libipsec.so.3.0			base-net-shlib		compatfile
 ./usr/lib/libirs.sobase-bind-shlib		compatfile
-./usr/lib/libirs.so.12base-bind-shlib		compatfile
-./usr/lib/libirs.so.12.0			base-bind-shlib		compatfile
+./usr/lib/libirs.so.13base-bind-shlib		compatfile
+./usr/lib/libirs.so.13.0			base-bind-shlib		compatfile
 ./usr/lib/libisc.sobase-bind-shlib		compatfile
-./usr/lib/libisc.so.12base-bind-shlib		compatfile
-./usr/lib/libisc.so.12.0			base-bind-shlib		compatfile
+./usr/lib/libisc.so.13base-bind-shlib		compatfile
+./usr/lib/libisc.so.13.0			base-bind-shlib		compatfile
 ./usr/lib/libisccc.sobase-bind-shlib		compatfile
 ./usr/lib/libisccc.so.12			base-bind-shlib		compatfile
 ./usr/lib/libisccc.so.12.0			base-bind-shlib		compatfile
 ./usr/lib/libisccfg.sobase-bind-shlib		compatfile
-./usr/lib/libisccfg.so.12			base-bind-shlib		compatfile
-./usr/lib/libisccfg.so.12.0			base-bind-shlib		compatfile
+./usr/lib/libisccfg.so.13			base-bind-shlib		compatfile
+./usr/lib/libisccfg.so.13.0			base-bind-shlib		compatfile
 ./usr/lib/libiscsi.sobase-iscsi-shlib	iscsi,compatfile
 ./usr/lib/libiscsi.so.2base-iscsi-shlib	iscsi,compatfile
 ./usr/lib/libiscsi.so.2.0			base-iscsi-shlib	iscsi,compatfile
@@ -429,8 +429,8 @@
 ./usr/lib/libnpf.so.0base-npf-shlib		npf,compatfile
 ./usr/lib/libnpf.so.0.1base-npf-shlib		npf,compatfile
 ./usr/lib/libns.sobase-bind-shlib		compatfile
-./usr/lib/libns.so.12base-bind-shlib		compatfile
-./usr/lib/libns.so.12.0base-bind-shlib		compatfile
+./usr/lib/libns.so.13base-bind-shlib		compatfile
+./usr/lib/libns.so.13.0base-bind-shlib		compatfile
 ./usr/lib/libnvpair.sobase-zfs-shlib		compatfile,zfs
 ./usr/lib/libnvpair.so.0			base-zfs-shlib		compatfile,zfs
 ./usr/lib/libnvpair.so.0.0			base-zfs-shlib		compatfile,zfs

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.226 src/distrib/sets/lists/debug/shl.mi:1.227
--- src/distrib/sets/lists/debug/shl.mi:1.226	Fri Aug 23 04:17:27 2019
+++ src/distrib/sets/lists/debug/shl.mi	Thu Sep  5 15:37:46 2019
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.226 2019/08/23 08:17:27 mrg Exp $
+# $NetBSD: shl.mi,v 1.227 2019/09/05 19:37:46 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
@@ -64,7 +64,7 @@
 ./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.16.0.debug		comp-sys-debug	debug,compatfile,binutils=231
-./usr/libdata/debug/usr/lib/libbind9.so.12.0.debug		comp-bind-debug	debug,compatfile
+./usr/libdata/debug/usr/lib/libbind9.so.13.0.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
 ./usr/libdata/debug/usr/lib/libbozohttpd.so.0.0.debug		comp-sys-debug	debug,compatfile
@@ -115,12 +115,12 @@
 ./usr/libdata/debug/usr/lib/libhx509.so.6.0.debug		comp-krb5-deb

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

2019-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Sep  5 17:25:24 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_mmc.c

Log Message:
The mmc module clock needs to be doubled only for 8bits DDR mode on old
timing hardware.
This makes the lime2-eemc works in 4bits DDR52 mode.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/sunxi/sunxi_mmc.c

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



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

2019-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Sep  5 17:25:24 UTC 2019

Modified Files:
src/sys/arch/arm/sunxi: sunxi_mmc.c

Log Message:
The mmc module clock needs to be doubled only for 8bits DDR mode on old
timing hardware.
This makes the lime2-eemc works in 4bits DDR52 mode.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/arm/sunxi/sunxi_mmc.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/sunxi/sunxi_mmc.c
diff -u src/sys/arch/arm/sunxi/sunxi_mmc.c:1.36 src/sys/arch/arm/sunxi/sunxi_mmc.c:1.37
--- src/sys/arch/arm/sunxi/sunxi_mmc.c:1.36	Sun Sep  1 15:02:17 2019
+++ src/sys/arch/arm/sunxi/sunxi_mmc.c	Thu Sep  5 17:25:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mmc.c,v 1.36 2019/09/01 15:02:17 jmcneill Exp $ */
+/* $NetBSD: sunxi_mmc.c,v 1.37 2019/09/05 17:25:23 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_sunximmc.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.36 2019/09/01 15:02:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mmc.c,v 1.37 2019/09/05 17:25:23 bouyer Exp $");
 
 #include 
 #include 
@@ -481,7 +481,7 @@ free:
 }
 
 static int
-sunxi_mmc_set_clock(struct sunxi_mmc_softc *sc, u_int freq, bool ddr)
+sunxi_mmc_set_clock(struct sunxi_mmc_softc *sc, u_int freq, bool ddr, bool dbl)
 {
 	const struct sunxi_mmc_delay *delays;
 	int error, timing = SUNXI_MMC_TIMING_400K;
@@ -507,7 +507,7 @@ sunxi_mmc_set_clock(struct sunxi_mmc_sof
 			return EINVAL;
 	}
 
-	error = clk_set_rate(sc->sc_clk_mmc, (freq * 1000) << ddr);
+	error = clk_set_rate(sc->sc_clk_mmc, (freq * 1000) << dbl);
 	if (error != 0)
 		return error;
 
@@ -555,7 +555,7 @@ sunxi_mmc_attach_i(device_t self)
 
 	sunxi_mmc_host_reset(sc);
 	sunxi_mmc_bus_width(sc, 1);
-	sunxi_mmc_set_clock(sc, 400, false);
+	sunxi_mmc_set_clock(sc, 400, false, false);
 
 	if (sc->sc_pwrseq)
 		fdtbus_mmc_pwrseq_post_power_on(sc->sc_pwrseq);
@@ -817,6 +817,7 @@ sunxi_mmc_bus_clock(sdmmc_chipset_handle
 	struct sunxi_mmc_softc *sc = sch;
 	uint32_t clkcr, gctrl, ntsr;
 	const u_int flags = sc->sc_config->flags;
+	bool dbl = 0;
 
 	clkcr = MMC_READ(sc, SUNXI_MMC_CLKCR);
 	if (clkcr & SUNXI_MMC_CLKCR_CARDCLKON) {
@@ -834,9 +835,15 @@ sunxi_mmc_bus_clock(sdmmc_chipset_handle
 	}
 
 	if (freq) {
+		/* For 8bits ddr in old timing modes, and all ddr in new
+		 * timing modes, the module clock has to be 2x the card clock.
+		 */
+		if (ddr && ((flags & SUNXI_MMC_FLAG_NEW_TIMINGS) ||
+		sc->sc_mmc_width == 8))
+			dbl = 1;
 
 		clkcr &= ~SUNXI_MMC_CLKCR_DIV;
-		clkcr |= __SHIFTIN(ddr, SUNXI_MMC_CLKCR_DIV);
+		clkcr |= __SHIFTIN(dbl, SUNXI_MMC_CLKCR_DIV);
 		MMC_WRITE(sc, SUNXI_MMC_CLKCR, clkcr);
 
 		if (flags & SUNXI_MMC_FLAG_NEW_TIMINGS) {
@@ -858,7 +865,7 @@ sunxi_mmc_bus_clock(sdmmc_chipset_handle
 			gctrl &= ~SUNXI_MMC_GCTRL_DDR_MODE;
 		MMC_WRITE(sc, SUNXI_MMC_GCTRL, gctrl);
 
-		if (sunxi_mmc_set_clock(sc, freq, ddr) != 0)
+		if (sunxi_mmc_set_clock(sc, freq, ddr, dbl) != 0)
 			return 1;
 
 		clkcr |= SUNXI_MMC_CLKCR_CARDCLKON;



CVS commit: src/sys

2019-09-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep  5 16:19:17 UTC 2019

Modified Files:
src/sys/kern: subr_asan.c
src/sys/sys: atomic.h

Log Message:
Add KASAN instrumentation on the atomic functions. Use macros to simplify.
These macros are prerequisites for future changes.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/subr_asan.c
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/atomic.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/subr_asan.c
diff -u src/sys/kern/subr_asan.c:1.10 src/sys/kern/subr_asan.c:1.11
--- src/sys/kern/subr_asan.c:1.10	Sat Jun 15 06:40:34 2019
+++ src/sys/kern/subr_asan.c	Thu Sep  5 16:19:16 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_asan.c,v 1.10 2019/06/15 06:40:34 maxv Exp $	*/
+/*	$NetBSD: subr_asan.c,v 1.11 2019/09/05 16:19:16 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.10 2019/06/15 06:40:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_asan.c,v 1.11 2019/09/05 16:19:16 maxv Exp $");
 
 #include 
 #include 
@@ -551,6 +551,228 @@ kasan_copyoutstr(const void *kaddr, void
 
 /* -- */
 
+#undef atomic_add_32
+#undef atomic_add_int
+#undef atomic_add_long
+#undef atomic_add_ptr
+#undef atomic_add_64
+#undef atomic_add_32_nv
+#undef atomic_add_int_nv
+#undef atomic_add_long_nv
+#undef atomic_add_ptr_nv
+#undef atomic_add_64_nv
+#undef atomic_and_32
+#undef atomic_and_uint
+#undef atomic_and_ulong
+#undef atomic_and_64
+#undef atomic_and_32_nv
+#undef atomic_and_uint_nv
+#undef atomic_and_ulong_nv
+#undef atomic_and_64_nv
+#undef atomic_or_32
+#undef atomic_or_uint
+#undef atomic_or_ulong
+#undef atomic_or_64
+#undef atomic_or_32_nv
+#undef atomic_or_uint_nv
+#undef atomic_or_ulong_nv
+#undef atomic_or_64_nv
+#undef atomic_cas_32
+#undef atomic_cas_uint
+#undef atomic_cas_ulong
+#undef atomic_cas_ptr
+#undef atomic_cas_64
+#undef atomic_cas_32_ni
+#undef atomic_cas_uint_ni
+#undef atomic_cas_ulong_ni
+#undef atomic_cas_ptr_ni
+#undef atomic_cas_64_ni
+#undef atomic_swap_32
+#undef atomic_swap_uint
+#undef atomic_swap_ulong
+#undef atomic_swap_ptr
+#undef atomic_swap_64
+#undef atomic_dec_32
+#undef atomic_dec_uint
+#undef atomic_dec_ulong
+#undef atomic_dec_ptr
+#undef atomic_dec_64
+#undef atomic_dec_32_nv
+#undef atomic_dec_uint_nv
+#undef atomic_dec_ulong_nv
+#undef atomic_dec_ptr_nv
+#undef atomic_dec_64_nv
+#undef atomic_inc_32
+#undef atomic_inc_uint
+#undef atomic_inc_ulong
+#undef atomic_inc_ptr
+#undef atomic_inc_64
+#undef atomic_inc_32_nv
+#undef atomic_inc_uint_nv
+#undef atomic_inc_ulong_nv
+#undef atomic_inc_ptr_nv
+#undef atomic_inc_64_nv
+
+#define ASAN_ATOMIC_FUNC_ADD(name, tret, targ1, targ2) \
+	void atomic_add_##name(volatile targ1 *, targ2); \
+	void kasan_atomic_add_##name(volatile targ1 *, targ2); \
+	void kasan_atomic_add_##name(volatile targ1 *ptr, targ2 val) \
+	{ \
+		kasan_shadow_check((uintptr_t)ptr, sizeof(tret), true, \
+		__RET_ADDR); \
+		atomic_add_##name(ptr, val); \
+	} \
+	tret atomic_add_##name##_nv(volatile targ1 *, targ2); \
+	tret kasan_atomic_add_##name##_nv(volatile targ1 *, targ2); \
+	tret kasan_atomic_add_##name##_nv(volatile targ1 *ptr, targ2 val) \
+	{ \
+		kasan_shadow_check((uintptr_t)ptr, sizeof(tret), true, \
+		__RET_ADDR); \
+		return atomic_add_##name##_nv(ptr, val); \
+	}
+
+#define ASAN_ATOMIC_FUNC_AND(name, tret, targ1, targ2) \
+	void atomic_and_##name(volatile targ1 *, targ2); \
+	void kasan_atomic_and_##name(volatile targ1 *, targ2); \
+	void kasan_atomic_and_##name(volatile targ1 *ptr, targ2 val) \
+	{ \
+		kasan_shadow_check((uintptr_t)ptr, sizeof(tret), true, \
+		__RET_ADDR); \
+		atomic_and_##name(ptr, val); \
+	} \
+	tret atomic_and_##name##_nv(volatile targ1 *, targ2); \
+	tret kasan_atomic_and_##name##_nv(volatile targ1 *, targ2); \
+	tret kasan_atomic_and_##name##_nv(volatile targ1 *ptr, targ2 val) \
+	{ \
+		kasan_shadow_check((uintptr_t)ptr, sizeof(tret), true, \
+		__RET_ADDR); \
+		return atomic_and_##name##_nv(ptr, val); \
+	}
+
+#define ASAN_ATOMIC_FUNC_OR(name, tret, targ1, targ2) \
+	void atomic_or_##name(volatile targ1 *, targ2); \
+	void kasan_atomic_or_##name(volatile targ1 *, targ2); \
+	void kasan_atomic_or_##name(volatile targ1 *ptr, targ2 val) \
+	{ \
+		kasan_shadow_check((uintptr_t)ptr, sizeof(tret), true, \
+		__RET_ADDR); \
+		atomic_or_##name(ptr, val); \
+	} \
+	tret atomic_or_##name##_nv(volatile targ1 *, targ2); \
+	tret kasan_atomic_or_##name##_nv(volatile targ1 *, targ2); \
+	tret kasan_atomic_or_##name##_nv(volatile targ1 *ptr, targ2 val) \
+	{ \
+		kasan_shadow_check((uintptr_t)ptr, sizeof(tret), true, \
+		__RET_ADDR); \
+		return atomic_or_##name##_nv(ptr, val); \
+	}
+
+#define ASAN_ATOMIC_FUNC_CAS(name, tret, targ1, targ2) \
+	tre

CVS commit: src/sys

2019-09-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep  5 16:19:17 UTC 2019

Modified Files:
src/sys/kern: subr_asan.c
src/sys/sys: atomic.h

Log Message:
Add KASAN instrumentation on the atomic functions. Use macros to simplify.
These macros are prerequisites for future changes.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/kern/subr_asan.c
cvs rdiff -u -r1.13 -r1.14 src/sys/sys/atomic.h

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



CVS commit: src/sys/dev/spi

2019-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Sep  5 16:17:48 UTC 2019

Modified Files:
src/sys/dev/spi: m25p.c

Log Message:
Add support for Winbond W25Q128.V (128mb) chips, as found on newer lime2-emmc
boards.
While there fix a missing \n in dmesg.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/spi/m25p.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/spi/m25p.c
diff -u src/sys/dev/spi/m25p.c:1.11 src/sys/dev/spi/m25p.c:1.12
--- src/sys/dev/spi/m25p.c:1.11	Tue Aug 13 17:11:32 2019
+++ src/sys/dev/spi/m25p.c	Thu Sep  5 16:17:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: m25p.c,v 1.11 2019/08/13 17:11:32 tnn Exp $ */
+/* $NetBSD: m25p.c,v 1.12 2019/09/05 16:17:48 bouyer Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: m25p.c,v 1.11 2019/08/13 17:11:32 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: m25p.c,v 1.12 2019/09/05 16:17:48 bouyer Exp $");
 
 #include 
 #include 
@@ -110,6 +110,7 @@ static const struct m25p_info {
 	{ 0x13, 0xEF, 0x4014, "Winbond W25Q80.V", 1024, 64 },	/* 8Mbit */
 	{ 0x14, 0xEF, 0x4015, "Winbond W25Q16.V", 2048, 64 },	/* 16Mbit */
 	{ 0x15, 0xEF, 0x4016, "Winbond W25Q32.V", 4096, 64 },	/* 32Mbit */
+	{ 0x15, 0xEF, 0x4018, "Winbond W25Q128.V", 16384, 64 },	/* 128Mbit */
 	{ 0x15, 0xEF, 0x6016, "Winbond W25Q32.W", 4096, 64 },	/* 32Mbit */
 	{ 0 }
 };
@@ -144,6 +145,9 @@ m25p_attach(device_t parent, device_t se
 
 	sc->sc_sh = sa->sa_handle;
 
+	aprint_normal("\n");
+	aprint_naive("\n");
+
 	config_interrupts(self, m25p_doattach);
 }
 



CVS commit: src/sys/dev/spi

2019-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Sep  5 16:17:48 UTC 2019

Modified Files:
src/sys/dev/spi: m25p.c

Log Message:
Add support for Winbond W25Q128.V (128mb) chips, as found on newer lime2-emmc
boards.
While there fix a missing \n in dmesg.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/spi/m25p.c

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



CVS commit: src/sys/arch

2019-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Sep  5 16:15:57 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: GENERIC
Added Files:
src/sys/arch/arm/dts: sun7i-a20-olinuxino-lime2-emmc-spi.dts

Log Message:
Add spiflash support in GENERIC
Add a dts enabling spi0 and attaching the SPI flash for newer lime2-emmc
boards.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc-spi.dts
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/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/evbarm/conf/GENERIC
diff -u src/sys/arch/evbarm/conf/GENERIC:1.51 src/sys/arch/evbarm/conf/GENERIC:1.52
--- src/sys/arch/evbarm/conf/GENERIC:1.51	Wed Aug 14 15:08:53 2019
+++ src/sys/arch/evbarm/conf/GENERIC	Thu Sep  5 16:15:57 2019
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC,v 1.51 2019/08/14 15:08:53 skrll Exp $
+#	$NetBSD: GENERIC,v 1.52 2019/09/05 16:15:57 bouyer Exp $
 #
 #	GENERIC ARM (aarch32) kernel
 #
@@ -96,6 +96,7 @@ makeoptions	DTS="
 	sun7i-a20-olimex-som204-evb-emmc.dts
 	sun7i-a20-olimex-som204-evb.dts
 	sun7i-a20-olinuxino-lime.dts
+	sun7i-a20-olinuxino-lime2-emmc-spi.dts
 	sun7i-a20-olinuxino-lime2-emmc.dts
 	sun7i-a20-olinuxino-lime2.dts
 	sun7i-a20-olinuxino-micro-emmc.dts
@@ -643,6 +644,10 @@ ss* 		at scsibus? target ? lun ?	# SCSI 
 ses* 		at scsibus? target ? lun ?	# SCSI SES/SAF-TE devices
 uk* 		at scsibus? target ? lun ?	# unknown SCSI
 
+# SPI NOR flash support
+m25p* at spi?
+spiflash* at spiflashbus?
+
 include "dev/usb/usbdevices.config"
 midi* 		at midibus?
 

Added files:

Index: src/sys/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc-spi.dts
diff -u /dev/null src/sys/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc-spi.dts:1.1
--- /dev/null	Thu Sep  5 16:15:57 2019
+++ src/sys/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc-spi.dts	Thu Sep  5 16:15:57 2019
@@ -0,0 +1,24 @@
+#include "sun7i-a20-olinuxino-lime2-emmc.dts"
+
+&pio {
+	spi0_pc_pins: spi0-pc-pins {
+		pins = "PC0", "PC1", "PC2";
+		function = "spi0";
+	};
+
+			spi0_cs0_pc_pin: spi0-cs0-pc-pin {
+		pins = "PC23";
+		function = "spi0";
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_pc_pins>, <&spi0_cs0_pc_pin>;
+	status = "okay";
+	spiflash {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		status = "okay";
+	};
+};



CVS commit: src/sys/arch

2019-09-05 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Thu Sep  5 16:15:57 UTC 2019

Modified Files:
src/sys/arch/evbarm/conf: GENERIC
Added Files:
src/sys/arch/arm/dts: sun7i-a20-olinuxino-lime2-emmc-spi.dts

Log Message:
Add spiflash support in GENERIC
Add a dts enabling spi0 and attaching the SPI flash for newer lime2-emmc
boards.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/sys/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc-spi.dts
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/evbarm/conf/GENERIC

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



CVS commit: src/sys/arch/mips/mips

2019-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep  5 15:48:13 UTC 2019

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
Fix a maya fix so that cobalt boots again.

Set MIPS_COP_0_CAUSE to zero before the rest of the initialisation


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/mips/mips/locore.S

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/mips/mips/locore.S
diff -u src/sys/arch/mips/mips/locore.S:1.219 src/sys/arch/mips/mips/locore.S:1.220
--- src/sys/arch/mips/mips/locore.S:1.219	Fri Sep  7 21:14:45 2018
+++ src/sys/arch/mips/mips/locore.S	Thu Sep  5 15:48:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.219 2018/09/07 21:14:45 macallan Exp $	*/
+/*	$NetBSD: locore.S,v 1.220 2019/09/05 15:48:13 skrll Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -63,7 +63,7 @@
 #include 
 #include 
 
-RCSID("$NetBSD: locore.S,v 1.219 2018/09/07 21:14:45 macallan Exp $")
+RCSID("$NetBSD: locore.S,v 1.220 2019/09/05 15:48:13 skrll Exp $")
 
 #include "assym.h"
 
@@ -73,10 +73,10 @@ RCSID("$NetBSD: locore.S,v 1.219 2018/09
 	.globl	_C_LABEL(kernel_text)		# libkvm refers this
 start:
 _C_LABEL(kernel_text):
+	/* First disable the interrupts only, for safety */
 	mfc0	k0, MIPS_COP_0_STATUS
 	MFC0_HAZARD
 
-	/* First disable the interrupts only, for safety */
 	and	k0, ~MIPS_SR_INT_IE
 	mtc0	k0, MIPS_COP_0_STATUS
 	COP0_SYNC
@@ -85,6 +85,7 @@ _C_LABEL(kernel_text):
 	/* Leaving TS | RE alone (for emips) */
 	and	k0, MIPS_SR_TS | MIPS3_SR_RE
 	mtc0	k0, MIPS_COP_0_STATUS
+	mtc0	zero, MIPS_COP_0_CAUSE
 	COP0_SYNC
 
 #if defined(_LP64) 



CVS commit: src/sys/arch/mips/mips

2019-09-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Sep  5 15:48:13 UTC 2019

Modified Files:
src/sys/arch/mips/mips: locore.S

Log Message:
Fix a maya fix so that cobalt boots again.

Set MIPS_COP_0_CAUSE to zero before the rest of the initialisation


To generate a diff of this commit:
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/mips/mips/locore.S

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



Re: CVS commit: src

2019-09-05 Thread Warner Losh
On Mon, Sep 2, 2019, 1:53 AM Masanobu SAITOH  wrote:

> Background:
>
>  In August 2014, lower-cased filename's files are added in the following
> commit:
>
>
> https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/radeon?id=f333bd435c0b6745cbc4fae3326725d77bf57c82
>
> This commit says those files use the new header format. The radeon's drmkms
> driver basically try to use lower case's file first and then try the upper
> case's one. [*1]
>
> After the above commit, usually lower-case's files have been added and
> updated.
> Two exceptions:
>
> TAHITI_vce.bin (only uppercase exists)
> BONAIRE_uvd.bin (both upper and lowe exist and both updated)
>
> Some old (upper-case'd) firmware might be maintained anymore.
>
> Now:
> Number of upper-cased filename's files: 158
> Number of lower-cased filename's files: 66
> Both lower-cased and upper-cased: 65
>
> kaveri_mec2.bin has only lowercase one.
> (see also:
> http://mail-index.netbsd.org/tech-x11/2019/04/07/msg001953.html)
>
> [*1] For _mc*.bin:
> 1st try: lower-case _mc.bin
> 2nd try: upper-case _mc2.bin
> 3rd try: upper-case _mc.bin
>
> So, options are:
>
> a) Remove duplicated upper-cased files.
>
>pros: Simple. It's not required to modify radeon driver itself.
>  It also works with new kernel with old filesysysm.
>cons: If the driver failed to load the lower cased firmware,
>  driver can't read the upper-cased firmware.
>
> b) Rename upper-case'd file to another name e.g.: foo_bar_old.bin
>
>pros: It can be keep the driver's behavior the same as linux's.
>cons: We have to modify many files and lines.
>  If we support new kernel + old filesystem, we should
> modify
>  the driver to load FOO_BAR.bin first and then
> FOO_BAR_old.bin.
>
> c) keep the current status as it is.
>
>pros: Any additional work is not required.
>cons: have trouble on case-insensitive file system.
>
> d) Any other options.
>

Option A is the best. There is no need in this case to keep the files that
I've seen.

If we do need them, then adding a directory for the old names / format
seems the best way forward (both in tree and new install location). Add the
new directory to the load path. MacOS builds are fine.

Warner


> --
> ---
> SAITOH Masanobu (msai...@execsw.org
>  msai...@netbsd.org)
>


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

2019-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  5 13:33:11 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3.c

Log Message:
- Use pic_do_pending_ints in intr handler
- Sprinkle isb
- Fix PMR bits detection on eMAG, from OpenBSD


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/cortex/gicv3.c

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



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

2019-09-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Sep  5 13:33:11 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: gicv3.c

Log Message:
- Use pic_do_pending_ints in intr handler
- Sprinkle isb
- Fix PMR bits detection on eMAG, from OpenBSD


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/cortex/gicv3.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/cortex/gicv3.c
diff -u src/sys/arch/arm/cortex/gicv3.c:1.20 src/sys/arch/arm/cortex/gicv3.c:1.21
--- src/sys/arch/arm/cortex/gicv3.c:1.20	Sun Jun 30 11:11:38 2019
+++ src/sys/arch/arm/cortex/gicv3.c	Thu Sep  5 13:33:11 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: gicv3.c,v 1.20 2019/06/30 11:11:38 jmcneill Exp $ */
+/* $NetBSD: gicv3.c,v 1.21 2019/09/05 13:33:11 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -31,7 +31,7 @@
 #define	_INTR_PRIVATE
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.20 2019/06/30 11:11:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gicv3.c,v 1.21 2019/09/05 13:33:11 jmcneill Exp $");
 
 #include 
 #include 
@@ -213,6 +213,7 @@ gicv3_set_priority(struct pic_softc *pic
 	struct gicv3_softc * const sc = PICTOSOFTC(pic);
 
 	icc_pmr_write(IPL_TO_PMR(sc, ipl));
+	arm_isb();
 }
 
 static void
@@ -437,14 +438,17 @@ gicv3_ipi_send(struct pic_softc *pic, co
 			if ((ci->ci_gic_sgir & ICC_SGIR_EL1_Aff) != aff) {
 if (targets != 0) {
 	icc_sgi1r_write(intid | aff | targets);
+	arm_isb();
 	targets = 0;
 }
 aff = (ci->ci_gic_sgir & ICC_SGIR_EL1_Aff);
 			}
 			targets |= (ci->ci_gic_sgir & ICC_SGIR_EL1_TargetList);
 		}
-		if (targets != 0)
+		if (targets != 0) {
 			icc_sgi1r_write(intid | aff | targets);
+			arm_isb();
+		}
 	}
 }
 
@@ -715,6 +719,7 @@ gicv3_irq_handler(void *frame)
 
 	for (;;) {
 		const uint32_t iar = icc_iar1_read();
+		arm_dsb();
 		const uint32_t irq = __SHIFTOUT(iar, ICC_IAR_INTID);
 		if (irq == ICC_IAR_INTID_SPURIOUS)
 			break;
@@ -726,26 +731,39 @@ gicv3_irq_handler(void *frame)
 		struct intrsource * const is = pic->pic_sources[irq - pic->pic_irqbase];
 		KASSERT(is != NULL);
 
+		const bool early_eoi = irq < GIC_LPI_BASE && is->is_type == IST_EDGE;
+
 		const int ipl = is->is_ipl;
-		if (ci->ci_cpl < ipl)
-			pic_set_priority(ci, ipl);
+		if (__predict_false(ipl < ci->ci_cpl)) {
+			pic_do_pending_ints(I32_bit, ipl, frame);
+		} else {
+			gicv3_set_priority(pic, ipl);
+			ci->ci_cpl = ipl;
+		}
+
+		if (early_eoi) {
+			icc_eoi1r_write(iar);
+			arm_isb();
+		}
 
 		cpsie(I32_bit);
 		pic_dispatch(is, frame);
 		cpsid(I32_bit);
 
-		icc_eoi1r_write(iar);
+		if (!early_eoi) {
+			icc_eoi1r_write(iar);
+			arm_isb();
+		}
 	}
 
-	if (ci->ci_cpl != oldipl)
-		pic_set_priority(ci, oldipl);
+	pic_do_pending_ints(I32_bit, oldipl, frame);
 }
 
 static int
 gicv3_detect_pmr_bits(struct gicv3_softc *sc)
 {
 	const uint32_t opmr = icc_pmr_read();
-	icc_pmr_write(0xff);
+	icc_pmr_write(0xbf);
 	const uint32_t npmr = icc_pmr_read();
 	icc_pmr_write(opmr);
 



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

2019-09-05 Thread Kamil Rytarowski
On 05.09.2019 14:57, Maxime Villard wrote:
> Module Name:  src
> Committed By: maxv
> Date: Thu Sep  5 12:57:30 UTC 2019
> 
> Modified Files:
>   src/sys/arch/amd64/amd64: lock_stubs.S
> 
> Log Message:
> Remove unused, and style.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/lock_stubs.S
> 
> 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/amd64/lock_stubs.S
> diff -u src/sys/arch/amd64/amd64/lock_stubs.S:1.31 
> src/sys/arch/amd64/amd64/lock_stubs.S:1.32
> --- src/sys/arch/amd64/amd64/lock_stubs.S:1.31Mon Feb 11 14:59:32 2019
> +++ src/sys/arch/amd64/amd64/lock_stubs.S Thu Sep  5 12:57:30 2019
> @@ -1,6 +1,6 @@
> -/*   $NetBSD: lock_stubs.S,v 1.31 2019/02/11 14:59:32 cherry Exp $   */
> +/*   $NetBSD: lock_stubs.S,v 1.32 2019/09/05 12:57:30 maxv Exp $ */
>  
> -/*-
> +/*
>   * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
>   * All rights reserved.
>   *

This is our style use /*- for comments that shall not be reformatted
(originally indent(1) specific).



signature.asc
Description: OpenPGP digital signature


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

2019-09-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep  5 12:57:30 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: lock_stubs.S

Log Message:
Remove unused, and style.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/lock_stubs.S

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



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

2019-09-05 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Sep  5 12:57:30 UTC 2019

Modified Files:
src/sys/arch/amd64/amd64: lock_stubs.S

Log Message:
Remove unused, and style.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/amd64/amd64/lock_stubs.S

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/amd64/lock_stubs.S
diff -u src/sys/arch/amd64/amd64/lock_stubs.S:1.31 src/sys/arch/amd64/amd64/lock_stubs.S:1.32
--- src/sys/arch/amd64/amd64/lock_stubs.S:1.31	Mon Feb 11 14:59:32 2019
+++ src/sys/arch/amd64/amd64/lock_stubs.S	Thu Sep  5 12:57:30 2019
@@ -1,6 +1,6 @@
-/*	$NetBSD: lock_stubs.S,v 1.31 2019/02/11 14:59:32 cherry Exp $	*/
+/*	$NetBSD: lock_stubs.S,v 1.32 2019/09/05 12:57:30 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -15,7 +15,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- *  
+ *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -29,15 +29,6 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-/*
- * AMD64 lock stubs.  Calling convention:
- *
- * %rdi		arg 1
- * %rsi		arg 2
- * %rdx		arg 3
- * %rax		return value
- */
-
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
 
@@ -46,31 +37,30 @@
 
 #include "assym.h"
 
-#define	ENDLABEL(name,a) .align	a; LABEL(name)
-#define	LOCK(num)	\
+#define LOCK	\
 	HOTPATCH(HP_NAME_NOLOCK, 1)	; \
 	lock
-#define	RET(num)	\
+#define RET	\
 	HOTPATCH(HP_NAME_RETFENCE, 3)	; \
 	ret; nop; nop			; \
 	ret
 
 #ifndef LOCKDEBUG
 
+	.align	64
+
 /*
  * void mutex_enter(kmutex_t *mtx);
  *
  * Acquire a mutex and post a load fence.
  */
-	.align	64
-
 ENTRY(mutex_enter)
 	movq	CPUVAR(CURLWP), %rcx
 	xorq	%rax, %rax
-	LOCK(1)
+	LOCK
 	cmpxchgq %rcx, (%rdi)
 	jnz	1f
-	RET(1)
+	RET
 1:
 	jmp	_C_LABEL(mutex_vector_enter)
 END(mutex_enter)
@@ -114,7 +104,7 @@ ENTRY(mutex_spin_enter)
 	testb	%al, %al
 	jnz	1f
 #endif
-	RET(2)
+	RET
 1:
 	jmp	_C_LABEL(mutex_spin_retry)	/* failed; hard case */
 END(mutex_spin_enter)
@@ -211,11 +201,11 @@ ENTRY(rw_enter)
 0:
 	testb	$(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
 	jnz	3f
-	leaq	RW_READ_INCR(%rax), %rdx 
-	LOCK(2)
+	leaq	RW_READ_INCR(%rax), %rdx
+	LOCK
 	cmpxchgq %rdx, (%rdi)
 	jnz	1f
-	RET(3)
+	RET
 1:
 	jmp	0b
 
@@ -225,10 +215,10 @@ ENTRY(rw_enter)
 2:	movq	CPUVAR(CURLWP), %rcx
 	xorq	%rax, %rax
 	orq	$RW_WRITE_LOCKED, %rcx
-	LOCK(3)
+	LOCK
 	cmpxchgq %rcx, (%rdi)
 	jnz	3f
-	RET(4)
+	RET
 3:
 	jmp	_C_LABEL(rw_vector_enter)
 END(rw_enter)
@@ -251,7 +241,7 @@ ENTRY(rw_exit)
 	cmpq	$RW_READ_INCR, %rax
 	jb	3f
 	leaq	-RW_READ_INCR(%rax), %rdx
-	LOCK(4)
+	LOCK
 	cmpxchgq %rdx, (%rdi)
 	jnz	1f
 	ret
@@ -264,7 +254,7 @@ ENTRY(rw_exit)
 2:	leaq	-RW_WRITE_LOCKED(%rax), %rdx
 	subq	CPUVAR(CURLWP), %rdx
 	jnz	3f
-	LOCK(5)
+	LOCK
 	cmpxchgq %rdx, (%rdi)
 	jnz	3f
 	ret
@@ -288,12 +278,12 @@ ENTRY(rw_tryenter)
 0:
 	testb	$(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
 	jnz	4f
-	leaq	RW_READ_INCR(%rax), %rdx 
-	LOCK(8)
+	leaq	RW_READ_INCR(%rax), %rdx
+	LOCK
 	cmpxchgq %rdx, (%rdi)
 	jnz	1f
 	movl	%edx, %eax			/* nonzero */
-	RET(5)
+	RET
 1:
 	jmp	0b
 
@@ -303,12 +293,12 @@ ENTRY(rw_tryenter)
 2:	movq	CPUVAR(CURLWP), %rcx
 	xorq	%rax, %rax
 	orq	$RW_WRITE_LOCKED, %rcx
-	LOCK(9)
+	LOCK
 	cmpxchgq %rcx, (%rdi)
 	movl	$0, %eax
 	setz	%al
 3:
-	RET(6)
+	RET
 	ret
 4:
 	xorl	%eax, %eax
@@ -328,10 +318,10 @@ END(__cpu_simple_lock_init)
 ENTRY(__cpu_simple_lock)
 	movl	$0x0100, %eax
 1:
-	LOCK(6)
+	LOCK
 	cmpxchgb %ah, (%rdi)
 	jnz	2f
-	RET(7)
+	RET
 2:
 	movl	$0x0100, %eax
 	pause
@@ -349,10 +339,10 @@ END(__cpu_simple_unlock)
 
 ENTRY(__cpu_simple_lock_try)
 	movl	$0x0100, %eax
-	LOCK(7)
+	LOCK
 	cmpxchgb %ah, (%rdi)
 	movl	$0, %eax
 	setz	%al
-	RET(8)
+	RET
 END(__cpu_simple_lock_try)
 



CVS commit: src

2019-09-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep  5 10:01:30 UTC 2019

Modified Files:
src/share/man/man4: ixv.4
src/sys/dev/pci/ixgbe: ixv.c

Log Message:
 Add support SIOCZIFDATA as ixgbe.c.

BUGS
 The following event counters are not cleared by SIOCZIFDATA because the
 corresponding registers are read only and not cleared on read:

   Good Packets Received
   Good Octets Received
   Multicast Packets Received
   Good Packets Transmitted
   Good Octets Transmitted


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/ixv.4
cvs rdiff -u -r1.130 -r1.131 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/share/man/man4/ixv.4
diff -u src/share/man/man4/ixv.4:1.4 src/share/man/man4/ixv.4:1.5
--- src/share/man/man4/ixv.4:1.4	Thu Jul 18 03:52:26 2019
+++ src/share/man/man4/ixv.4	Thu Sep  5 10:01:30 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ixv.4,v 1.4 2019/07/18 03:52:26 msaitoh Exp $
+.\"	$NetBSD: ixv.4,v 1.5 2019/09/05 10:01:30 msaitoh Exp $
 .\"
 .\" Copyright (c) 2018 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 July 18, 2019
+.Dd September 5, 2019
 .Dt IXV 4
 .Os
 .Sh NAME
@@ -61,3 +61,20 @@ The
 .Nm
 driver was written by
 .An Intel Corporation Aq Mt freebsd...@mailbox.intel.com .
+.Sh BUGS
+The following event counters are not cleared by
+.Dv SIOCZIFDATA
+because the corresponding registers are read only and not cleared on read:
+.Pp
+.Bl -item -offset indent -compact
+.It
+Good Packets Received
+.It
+Good Octets Received
+.It
+Multicast Packets Received
+.It
+Good Packets Transmitted
+.It
+Good Octets Transmitted
+.El

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.130 src/sys/dev/pci/ixgbe/ixv.c:1.131
--- src/sys/dev/pci/ixgbe/ixv.c:1.130	Wed Sep  4 10:34:04 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Sep  5 10:01:30 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.130 2019/09/04 10:34:04 msaitoh Exp $*/
+/*$NetBSD: ixv.c,v 1.131 2019/09/05 10:01:30 msaitoh Exp $*/
 
 /**
 
@@ -131,6 +131,7 @@ static void	ixv_save_stats(struct adapte
 static void	ixv_init_stats(struct adapter *);
 static void	ixv_update_stats(struct adapter *);
 static void	ixv_add_stats_sysctls(struct adapter *);
+static void	ixv_clear_evcnt(struct adapter *);
 
 /* Sysctl handlers */
 static void	ixv_set_sysctl_value(struct adapter *, const char *,
@@ -2630,6 +2631,76 @@ ixv_add_stats_sysctls(struct adapter *ad
 
 } /* ixv_add_stats_sysctls */
 
+static void
+ixv_clear_evcnt(struct adapter *adapter)
+{
+	struct tx_ring		*txr = adapter->tx_rings;
+	struct rx_ring		*rxr = adapter->rx_rings;
+	struct ixgbevf_hw_stats *stats = &adapter->stats.vf;
+	struct ixgbe_hw *hw = &adapter->hw;
+	int i;
+
+	/* Driver Statistics */
+	adapter->efbig_tx_dma_setup.ev_count = 0;
+	adapter->mbuf_defrag_failed.ev_count = 0;
+	adapter->efbig2_tx_dma_setup.ev_count = 0;
+	adapter->einval_tx_dma_setup.ev_count = 0;
+	adapter->other_tx_dma_setup.ev_count = 0;
+	adapter->eagain_tx_dma_setup.ev_count = 0;
+	adapter->enomem_tx_dma_setup.ev_count = 0;
+	adapter->watchdog_events.ev_count = 0;
+	adapter->tso_err.ev_count = 0;
+	adapter->link_irq.ev_count = 0;
+
+	for (i = 0; i < adapter->num_queues; i++, rxr++, txr++) {
+		adapter->queues[i].irqs.ev_count = 0;
+		adapter->queues[i].handleq.ev_count = 0;
+		adapter->queues[i].req.ev_count = 0;
+		txr->tso_tx.ev_count = 0;
+		txr->no_desc_avail.ev_count = 0;
+		txr->total_packets.ev_count = 0;
+#ifndef IXGBE_LEGACY_TX
+		txr->pcq_drops.ev_count = 0;
+#endif
+		txr->q_efbig_tx_dma_setup = 0;
+		txr->q_mbuf_defrag_failed = 0;
+		txr->q_efbig2_tx_dma_setup = 0;
+		txr->q_einval_tx_dma_setup = 0;
+		txr->q_other_tx_dma_setup = 0;
+		txr->q_eagain_tx_dma_setup = 0;
+		txr->q_enomem_tx_dma_setup = 0;
+		txr->q_tso_err = 0;
+
+		rxr->rx_packets.ev_count = 0;
+		rxr->rx_bytes.ev_count = 0;
+		rxr->rx_copies.ev_count = 0;
+		rxr->no_jmbuf.ev_count = 0;
+		rxr->rx_discarded.ev_count = 0;
+	}
+
+	/* MAC stats get their own sub node */
+
+	stats->ipcs.ev_count = 0;
+	stats->l4cs.ev_count = 0;
+	stats->ipcs_bad.ev_count = 0;
+	stats->l4cs_bad.ev_count = 0;
+
+	/* Packet Reception Stats */
+	stats->vfgprc.ev_count = 0;
+	stats->vfgorc.ev_count = 0;
+	stats->vfmprc.ev_count = 0;
+	stats->vfgptc.ev_count = 0;
+	stats->vfgotc.ev_count = 0;
+
+	/* Mailbox Stats */
+	hw->mbx.stats.msgs_tx.ev_count = 0;
+	hw->mbx.stats.msgs_rx.ev_count = 0;
+	hw->mbx.stats.acks.ev_count = 0;
+	hw->mbx.stats.reqs.ev_count = 0;
+	hw->mbx.stats.rsts.ev_count = 0;
+
+} /* ixv_clear_evcnt */
+
 /
  * ixv_set_sysctl_value
  *

CVS commit: src

2019-09-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep  5 10:01:30 UTC 2019

Modified Files:
src/share/man/man4: ixv.4
src/sys/dev/pci/ixgbe: ixv.c

Log Message:
 Add support SIOCZIFDATA as ixgbe.c.

BUGS
 The following event counters are not cleared by SIOCZIFDATA because the
 corresponding registers are read only and not cleared on read:

   Good Packets Received
   Good Octets Received
   Multicast Packets Received
   Good Packets Transmitted
   Good Octets Transmitted


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man4/ixv.4
cvs rdiff -u -r1.130 -r1.131 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.



CVS commit: src/sys/kern

2019-09-05 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Sep  5 09:20:05 UTC 2019

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

Log Message:
requires memory barrier before IPI ack.
Problem was seen on the aarch64 cpus.

Fixes PR/54009


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/subr_ipi.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_ipi.c
diff -u src/sys/kern/subr_ipi.c:1.4 src/sys/kern/subr_ipi.c:1.5
--- src/sys/kern/subr_ipi.c:1.4	Sat Apr  6 02:59:05 2019
+++ src/sys/kern/subr_ipi.c	Thu Sep  5 09:20:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_ipi.c,v 1.4 2019/04/06 02:59:05 thorpej Exp $	*/
+/*	$NetBSD: subr_ipi.c,v 1.5 2019/09/05 09:20:05 ryo Exp $	*/
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_ipi.c,v 1.4 2019/04/06 02:59:05 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_ipi.c,v 1.5 2019/09/05 09:20:05 ryo Exp $");
 
 #include 
 #include 
@@ -331,6 +331,9 @@ ipi_msg_cpu_handler(void *arg __unused)
 		msg->func(msg->arg);
 
 		/* Ack the request. */
+#ifndef __HAVE_ATOMIC_AS_MEMBAR
+		membar_producer();
+#endif
 		atomic_dec_uint(&msg->_pending);
 	}
 }



CVS commit: src/sys/kern

2019-09-05 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Thu Sep  5 09:20:05 UTC 2019

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

Log Message:
requires memory barrier before IPI ack.
Problem was seen on the aarch64 cpus.

Fixes PR/54009


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/subr_ipi.c

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



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:12:13 UTC 2019

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

Log Message:
Tickets #177 - #180


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 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.44 src/doc/CHANGES-9.0:1.1.2.45
--- src/doc/CHANGES-9.0:1.1.2.44	Thu Sep  5 08:47:02 2019
+++ src/doc/CHANGES-9.0	Thu Sep  5 09:12:12 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.44 2019/09/05 08:47:02 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.45 2019/09/05 09:12:12 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2793,3 +2793,63 @@ tests/net/ndp/t_ndp.sh1.36
 	Add tests for RTM_MISS.
 	[roy, ticket #175]
 
+external/bsd/dhcpcd/dist/BUILDING.mdup to 1.1.1.5
+external/bsd/dhcpcd/dist/Makefile   up to 1.1.1.7
+external/bsd/dhcpcd/dist/Makefile.inc   up to 1.1.1.3
+external/bsd/dhcpcd/dist/configure  up to 1.1.1.15
+external/bsd/dhcpcd/dist/compat/rb.cup to 1.1.1.2
+external/bsd/dhcpcd/dist/compat/rbtree.hup to 1.1.1.2
+external/bsd/dhcpcd/dist/hooks/Makefile up to 1.1.1.2
+external/bsd/dhcpcd/dist/src/Makefile   up to 1.1.1.6
+external/bsd/dhcpcd/dist/src/bpf.c  up to 1.12
+external/bsd/dhcpcd/dist/src/control.c  up to 1.1.1.8
+external/bsd/dhcpcd/dist/src/control.h  up to 1.1.1.5
+external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.27
+external/bsd/dhcpcd/dist/src/dhcp-common.c  up to 1.1.1.8
+external/bsd/dhcpcd/dist/src/dhcp.c up to 1.25
+external/bsd/dhcpcd/dist/src/dhcp6.cup to 1.12
+external/bsd/dhcpcd/dist/src/dhcpcd.8.inup to 1.3
+external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.25
+external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.14
+external/bsd/dhcpcd/dist/src/duid.c up to 1.1.1.7
+external/bsd/dhcpcd/dist/src/if-bsd.c   up to 1.12
+external/bsd/dhcpcd/dist/src/if-linux.c up to 1.1.1.16
+external/bsd/dhcpcd/dist/src/if-options.c   up to 1.17
+external/bsd/dhcpcd/dist/src/if-options.h   up to 1.1.1.11
+external/bsd/dhcpcd/dist/src/if-sun.c   up to 1.1.1.11
+external/bsd/dhcpcd/dist/src/if.c   up to 1.1.1.16
+external/bsd/dhcpcd/dist/src/if.h   up to 1.1.1.11
+external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.17
+external/bsd/dhcpcd/dist/src/ipv4.h up to 1.1.1.10
+external/bsd/dhcpcd/dist/src/ipv6.c up to 1.4
+external/bsd/dhcpcd/dist/src/ipv6.h up to 1.5
+external/bsd/dhcpcd/dist/src/ipv6nd.c   up to 1.11
+external/bsd/dhcpcd/dist/src/ipv6nd.h   up to 1.1.1.11
+external/bsd/dhcpcd/dist/src/route.cup to 1.1.1.14
+external/bsd/dhcpcd/dist/src/route.hup to 1.1.1.9
+external/bsd/dhcpcd/dist/src/sa.c   up to 1.1.1.6
+external/bsd/dhcpcd/dist/src/script.c   up to 1.1.1.11
+
+	Import dhcpcd-8.0.4.
+	[roy, ticket #177]
+
+share/man/man4/options.4			1.507
+
+	PR kern/54438: fix makeoptions DEBUG="-g" documentation.
+	[gson, ticket #178]
+
+sys/dev/ata/satafis_subr.c			1.9
+
+	PR kern/54389: make the sata driver work with the virtual
+	SATA CD-ROM of "qemu-system-i386 -machine q35".
+	[gson, ticket #179]
+
+sys/dev/pci/ixgbe/ix_txrx.c			1.55
+sys/dev/pci/ixgbe/ixgbe.c			1.207,1.208
+sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.10
+sys/dev/pci/ixgbe/ixv.c1.129,1.130
+
+	printf/device_printf/aprint_* cosmetics.
+	Set IFM_1000_BX10 correctly.
+	[msaitoh, ticket #180]
+



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:12:13 UTC 2019

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

Log Message:
Tickets #177 - #180


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.44 -r1.1.2.45 src/doc/CHANGES-9.0

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



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:11:03 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_netbsd.c
ixv.c

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

sys/dev/pci/ixgbe/ixv.c: revision 1.130
sys/dev/pci/ixgbe/ixgbe.c: revision 1.207
sys/dev/pci/ixgbe/ixgbe.c: revision 1.208
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.55
sys/dev/pci/ixgbe/ixv.c: revision 1.129
sys/dev/pci/ixgbe/ixgbe_netbsd.c: revision 1.10

 printf -> device_printf

 Set IFM_1000_BX10 correctly.

 Use aprint_*() in the attach function.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.2.1 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.3 -r1.199.2.4 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.125.2.2 -r1.125.2.3 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.



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:11:03 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-9]: ix_txrx.c ixgbe.c ixgbe_netbsd.c
ixv.c

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

sys/dev/pci/ixgbe/ixv.c: revision 1.130
sys/dev/pci/ixgbe/ixgbe.c: revision 1.207
sys/dev/pci/ixgbe/ixgbe.c: revision 1.208
sys/dev/pci/ixgbe/ix_txrx.c: revision 1.55
sys/dev/pci/ixgbe/ixv.c: revision 1.129
sys/dev/pci/ixgbe/ixgbe_netbsd.c: revision 1.10

 printf -> device_printf

 Set IFM_1000_BX10 correctly.

 Use aprint_*() in the attach function.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.54.2.1 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.199.2.3 -r1.199.2.4 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.9 -r1.9.4.1 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.125.2.2 -r1.125.2.3 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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.54 src/sys/dev/pci/ixgbe/ix_txrx.c:1.54.2.1
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.54	Thu Jul  4 08:56:35 2019
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Sep  5 09:11:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.54 2019/07/04 08:56:35 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.54.2.1 2019/09/05 09:11:03 martin Exp $ */
 
 /**
 
@@ -1363,7 +1363,9 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 			error = bus_dmamap_load_mbuf(rxr->ptag->dt_dmat,
 			rxbuf->pmap, mp, BUS_DMA_NOWAIT);
 			if (error != 0) {
-printf("Refresh mbufs: payload dmamap load failure - %d\n", error);
+device_printf(adapter->dev, "Refresh mbufs: "
+"payload dmamap load failure - %d\n",
+error);
 m_free(mp);
 rxbuf->buf = NULL;
 goto update;

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.3 src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.4
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.199.2.3	Sun Sep  1 13:08:12 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Sep  5 09:11:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.199.2.3 2019/09/01 13:08:12 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.199.2.4 2019/09/05 09:11:03 martin Exp $ */
 
 /**
 
@@ -1403,7 +1403,6 @@ static void
 ixgbe_add_media_types(struct adapter *adapter)
 {
 	struct ixgbe_hw *hw = &adapter->hw;
-	device_t	dev = adapter->dev;
 	u64		layer;
 
 	layer = adapter->phy_layer;
@@ -1469,7 +1468,7 @@ ixgbe_add_media_types(struct adapter *ad
 		ADD(IFM_5000_T | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX)
-		device_printf(dev, "Media supported: 1000baseBX\n");
+		ADD(IFM_1000_BX10 | IFM_FDX, 0);
 	/* XXX no ifmedia_set? */
 
 	ADD(IFM_AUTO, 0);
@@ -3306,7 +3305,8 @@ ixgbe_sysctl_instance(struct adapter *ad
 
 	return rnode;
 err:
-	printf("%s: sysctl_createv failed, rc = %d\n", __func__, rc);
+	device_printf(adapter->dev,
+	"%s: sysctl_createv failed, rc = %d\n", __func__, rc);
 	return NULL;
 }
 

Index: src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
diff -u src/sys/dev/pci/ixgbe/ixgbe_netbsd.c:1.9 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c:1.9.4.1
--- src/sys/dev/pci/ixgbe/ixgbe_netbsd.c:1.9	Thu Dec  6 13:25:02 2018
+++ src/sys/dev/pci/ixgbe/ixgbe_netbsd.c	Thu Sep  5 09:11:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_netbsd.c,v 1.9 2018/12/06 13:25:02 msaitoh Exp $ */
+/* $NetBSD: ixgbe_netbsd.c,v 1.9.4.1 2019/09/05 09:11:03 martin Exp $ */
 /*
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -197,7 +197,8 @@ ixgbe_jcl_reinit(struct adapter *adapter
 
 	for (i = 0; i < nbuf; i++) {
 		if ((em = ixgbe_newext(eh, dmat, size)) == NULL) {
-			printf("%s: only %d of %d jumbo buffers allocated\n",
+			device_printf(adapter->dev,
+			"%s: only %d of %d jumbo buffers allocated\n",
 			__func__, i, nbuf);
 			break;
 		}

Index: src/sys/dev/pci/ixgbe/ixv.c
diff -u src/sys/dev/pci/ixgbe/ixv.c:1.125.2.2 src/sys/dev/pci/ixgbe/ixv.c:1.125.2.3
--- src/sys/dev/pci/ixgbe/ixv.c:1.125.2.2	Sun Sep  1 11:12:45 2019
+++ src/sys/dev/pci/ixgbe/ixv.c	Thu Sep  5 09:11:03 2019
@@ -1,4 +1,4 @@
-/*$NetBSD: ixv.c,v 1.125.2.2 2019/09/01 11:12:45 martin Exp $*/
+/*$NetBSD: ixv.c,v 1.125.2.3 2019/09/05 09:11:03 martin Exp $*/
 
 /**
 
@@ -516,7 +516,7 @@ ixv_attach(device_t parent, device_t dev
 
 	error = ixv_allocate_msix(adapter, pa);
 	if (error) {
-		device_printf(dev, "ixv_allocate_msix() failed!\n");
+		aprint_error_dev(dev, "ixv_allocate_msix() failed!\n");
 		goto err_late;
 	}
 
@@ -2406,7 +2406,8 @@ ixv_sysctl_instance(struct adapter *adap
 
 	return rnode;
 err:
-	printf("%s: sysctl_createv failed, rc = %d\n", __f

CVS commit: [netbsd-8] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:07:43 UTC 2019

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

Log Message:
Ticket #1367


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.33 -r1.1.2.34 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.33 src/doc/CHANGES-8.2:1.1.2.34
--- src/doc/CHANGES-8.2:1.1.2.33	Tue Sep  3 12:21:15 2019
+++ src/doc/CHANGES-8.2	Thu Sep  5 09:07:42 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.33 2019/09/03 12:21:15 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.34 2019/09/05 09:07:42 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -851,3 +851,22 @@ sys/sys/cprng.h	1.13-1.15
 	Switch from NIST CTR_DRBG with AES to NIST Hash_DRBG with SHA-256.
 	[riastradh, ticket #1365]
 
+sys/dev/pci/ixgbe/ixgbe_x550.c			1.16
+sys/dev/pci/ixgbe/ixgbe.c			1.180,1.203-1.204,1.207-1.208 via patch
+sys/dev/pci/ixgbe/ix_txrx.c			1.55
+sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.10
+sys/dev/pci/ixgbe/ixgbe_common.c		1.25
+sys/dev/pci/ixgbe/ixv.c1.129-1.130
+
+	- X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp too.
+	- An interrupt might not arrive when a module is inserted. When an link
+	  status change interrupt occurred and the driver still regard SFP as
+	  unplugged, issue the module softint before issuing LSC softint.
+	- Add 1BASE-LX media if it's 1000BASE-BX.
+	- printf -> device_printf
+	- Avoid undefined behavior of VLAN filter setting.
+	- Simplify code.
+	- Fix typo in unused code.
+	- Fix typo in comment. Found by Wataru Ashihara.
+	[msaitoh, ticket #1367]
+



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:06:08 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe_common.c
ixgbe_netbsd.c ixgbe_x550.c ixv.c

Log Message:
Apply patch, requested by msaitoh in ticket #1367, to pull up the following
revisions:

sys/dev/pci/ixgbe/ixgbe_x550.c  1.16
sys/dev/pci/ixgbe/ixgbe.c   1.180,1.203-1.204,
1.207-1.208 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.55
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.10
sys/dev/pci/ixgbe/ixgbe_common.c1.25
sys/dev/pci/ixgbe/ixv.c 1.129-1.130

- X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp too.
- An interrupt might not arrive when a module is inserted. When an link
  status change interrupt occurred and the driver still regard SFP as
  unplugged, issue the module softint before issuing LSC softint.
- Add 1BASE-LX media if it's 1000BASE-BX.
- printf -> device_printf
- Avoid undefined behavior of VLAN filter setting.
- Simplify code.
- Fix typo in unused code.
- Fix typo in comment. Found by Wataru Ashihara.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.16 -r1.24.2.17 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.32 -r1.88.2.33 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.5.6.6 -r1.5.6.7 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.56.2.23 -r1.56.2.24 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/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.16 src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.17
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.24.2.16	Mon Jul 22 17:53:35 2019
+++ src/sys/dev/pci/ixgbe/ix_txrx.c	Thu Sep  5 09:06:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.24.2.16 2019/07/22 17:53:35 martin Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.24.2.17 2019/09/05 09:06:07 martin Exp $ */
 
 /**
 
@@ -1363,7 +1363,9 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr,
 			error = bus_dmamap_load_mbuf(rxr->ptag->dt_dmat,
 			rxbuf->pmap, mp, BUS_DMA_NOWAIT);
 			if (error != 0) {
-printf("Refresh mbufs: payload dmamap load failure - %d\n", error);
+device_printf(adapter->dev, "Refresh mbufs: "
+"payload dmamap load failure - %d\n",
+error);
 m_free(mp);
 rxbuf->buf = NULL;
 goto update;

Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.32 src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.33
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.88.2.32	Thu Aug 29 16:31:53 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Sep  5 09:06:07 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.88.2.32 2019/08/29 16:31:53 martin Exp $ */
+/* $NetBSD: ixgbe.c,v 1.88.2.33 2019/09/05 09:06:07 martin Exp $ */
 
 /**
 
@@ -1397,7 +1397,6 @@ static void
 ixgbe_add_media_types(struct adapter *adapter)
 {
 	struct ixgbe_hw *hw = &adapter->hw;
-	device_t	dev = adapter->dev;
 	u64		layer;
 
 	layer = adapter->phy_layer;
@@ -1449,7 +1448,7 @@ ixgbe_add_media_types(struct adapter *ad
 		ADD(IFM_10G_KR | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KX4) {
-		ADD(AIFM_10G_KX4 | IFM_FDX, 0);
+		ADD(IFM_10G_KX4 | IFM_FDX, 0);
 	}
 #else
 	if (layer & IXGBE_PHYSICAL_LAYER_10GBASE_KR) {
@@ -1476,7 +1475,7 @@ ixgbe_add_media_types(struct adapter *ad
 		ADD(IFM_5000_T | IFM_FDX, 0);
 	}
 	if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_BX)
-		device_printf(dev, "Media supported: 1000baseBX\n");
+		ADD(IFM_1000_LX | IFM_FDX, 0); /* IFM_1000_BX */
 	/* XXX no ifmedia_set? */
 
 	ADD(IFM_AUTO, 0);
@@ -1496,6 +1495,8 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
 			return (TRUE);
 		return (FALSE);
 	case ixgbe_mac_82599EB:
+	case ixgbe_mac_X550EM_x:
+	case ixgbe_mac_X550EM_a:
 		switch (hw->mac.ops.get_media_type(hw)) {
 		case ixgbe_media_type_fiber:
 		case ixgbe_media_type_fiber_qsfp:
@@ -1503,11 +1504,6 @@ ixgbe_is_sfp(struct ixgbe_hw *hw)
 		default:
 			return (FALSE);
 		}
-	case ixgbe_mac_X550EM_x:
-	case ixgbe_mac_X550EM_a:
-		if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
-			return (TRUE);
-		return (FALSE);
 	default:
 		return (FALSE);
 	}
@@ -2542,7 +2538,7 @@ ixgbe_enable_queue(struct adapter *adapt
 {
 	struct ixgbe_hw *hw = &adapter->hw;
 	struct ix_queue *que = &adapter->queues[vector];
-	u64		queue = (u64)(1ULL << vector);
+	u64		queue = 1ULL << vector;
 	u32		mask;
 
 	mutex_enter(&que->dc_mtx);
@@ -3077,6 +3073,34 @@ ixgbe_msix_link(void *arg)
 	/* Clear interrupt with write */

CVS commit: [netbsd-8] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:07:43 UTC 2019

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

Log Message:
Ticket #1367


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

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



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:06:08 UTC 2019

Modified Files:
src/sys/dev/pci/ixgbe [netbsd-8]: ix_txrx.c ixgbe.c ixgbe_common.c
ixgbe_netbsd.c ixgbe_x550.c ixv.c

Log Message:
Apply patch, requested by msaitoh in ticket #1367, to pull up the following
revisions:

sys/dev/pci/ixgbe/ixgbe_x550.c  1.16
sys/dev/pci/ixgbe/ixgbe.c   1.180,1.203-1.204,
1.207-1.208 via patch
sys/dev/pci/ixgbe/ix_txrx.c 1.55
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.10
sys/dev/pci/ixgbe/ixgbe_common.c1.25
sys/dev/pci/ixgbe/ixv.c 1.129-1.130

- X550EM supports QSFP, so check ixgbe_media_type_fiber_qsfp too.
- An interrupt might not arrive when a module is inserted. When an link
  status change interrupt occurred and the driver still regard SFP as
  unplugged, issue the module softint before issuing LSC softint.
- Add 1BASE-LX media if it's 1000BASE-BX.
- printf -> device_printf
- Avoid undefined behavior of VLAN filter setting.
- Simplify code.
- Fix typo in unused code.
- Fix typo in comment. Found by Wataru Ashihara.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.16 -r1.24.2.17 src/sys/dev/pci/ixgbe/ix_txrx.c
cvs rdiff -u -r1.88.2.32 -r1.88.2.33 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.13.2.6 -r1.13.2.7 src/sys/dev/pci/ixgbe/ixgbe_common.c
cvs rdiff -u -r1.6.2.3 -r1.6.2.4 src/sys/dev/pci/ixgbe/ixgbe_netbsd.c
cvs rdiff -u -r1.5.6.6 -r1.5.6.7 src/sys/dev/pci/ixgbe/ixgbe_x550.c
cvs rdiff -u -r1.56.2.23 -r1.56.2.24 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.



CVS commit: [netbsd-9] src/sys/dev/ata

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:02:48 UTC 2019

Modified Files:
src/sys/dev/ata [netbsd-9]: satafis_subr.c

Log Message:
Pull up following revision(s) (requested by gson in ticket #179):

sys/dev/ata/satafis_subr.c: revision 1.9

Set the ATAPI "BYTE COUNT LIMIT" field in the SATA case like we
already do in the ATA case, to make NetBSD work with the virtual
SATA CD-ROM of "qemu-system-i386 -machine q35".  Fixes PR kern/54389.

OK mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/dev/ata/satafis_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/ata/satafis_subr.c
diff -u src/sys/dev/ata/satafis_subr.c:1.8 src/sys/dev/ata/satafis_subr.c:1.8.10.1
--- src/sys/dev/ata/satafis_subr.c:1.8	Sat Oct  7 16:05:32 2017
+++ src/sys/dev/ata/satafis_subr.c	Thu Sep  5 09:02:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: satafis_subr.c,v 1.8 2017/10/07 16:05:32 jdolecek Exp $ */
+/* $NetBSD: satafis_subr.c,v 1.8.10.1 2019/09/05 09:02:48 martin Exp $ */
 
 /*-
  * Copyright (c) 2009 Jonathan A. Kollasch.
@@ -51,7 +51,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.8 2017/10/07 16:05:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: satafis_subr.c,v 1.8.10.1 2019/09/05 09:02:48 martin Exp $");
 
 #include 
 #include 
@@ -149,12 +149,16 @@ satafis_rhd_construct_bio(struct ata_xfe
 void
 satafis_rhd_construct_atapi(struct ata_xfer *xfer, uint8_t *fis)
 {
+	int bcount16;
 
 	memset(fis, 0, RHD_FISLEN);
 
 	fis[fis_type] = RHD_FISTYPE;
 	fis[rhd_c] = RHD_C;
 	fis[rhd_command] = ATAPI_PKT_CMD;
+	bcount16 = xfer->c_bcount <= 0x ? xfer->c_bcount : 0x;
+	fis[rhd_lba1] = (bcount16 >> 0) & 0xff;
+	fis[rhd_lba2] = (bcount16 >> 8) & 0xff;
 	fis[rhd_features0] = (xfer->c_flags & C_DMA) ?
 	ATAPI_PKT_CMD_FTRE_DMA : 0;
 }



CVS commit: [netbsd-9] src/sys/dev/ata

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:02:48 UTC 2019

Modified Files:
src/sys/dev/ata [netbsd-9]: satafis_subr.c

Log Message:
Pull up following revision(s) (requested by gson in ticket #179):

sys/dev/ata/satafis_subr.c: revision 1.9

Set the ATAPI "BYTE COUNT LIMIT" field in the SATA case like we
already do in the ATA case, to make NetBSD work with the virtual
SATA CD-ROM of "qemu-system-i386 -machine q35".  Fixes PR kern/54389.

OK mlelstv.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.10.1 src/sys/dev/ata/satafis_subr.c

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



CVS commit: [netbsd-9] src/share/man/man4

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:00:22 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: options.4

Log Message:
Pull up following revision(s) (requested by gson in ticket #178):

share/man/man4/options.4: revision 1.507

Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
because it does not.  Fixes PR kern/54438.


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.506.2.1 src/share/man/man4/options.4

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/options.4
diff -u src/share/man/man4/options.4:1.506 src/share/man/man4/options.4:1.506.2.1
--- src/share/man/man4/options.4:1.506	Wed May 22 15:17:48 2019
+++ src/share/man/man4/options.4	Thu Sep  5 09:00:22 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: options.4,v 1.506 2019/05/22 15:17:48 wiz Exp $
+.\"	$NetBSD: options.4,v 1.506.2.1 2019/09/05 09:00:22 martin Exp $
 .\"
 .\" Copyright (c) 1996
 .\" 	Perry E. Metzger.  All rights reserved.
@@ -30,7 +30,7 @@
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
 .\"
-.Dd May 21, 2019
+.Dd August 20, 2019
 .Dt OPTIONS 4
 .Os
 .Sh NAME
@@ -604,9 +604,6 @@ is useful for debugging kernel crash dum
 See
 .Xr gdb 1
 for details.
-This also turns on
-.Em options DEBUG
-(which see).
 .It Cd options DEBUG
 Turns on miscellaneous kernel debugging.
 Since options are turned into preprocessor defines (see above),



CVS commit: [netbsd-9] src/share/man/man4

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 09:00:22 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: options.4

Log Message:
Pull up following revision(s) (requested by gson in ticket #178):

share/man/man4/options.4: revision 1.507

Don't say that makeoptions DEBUG="-g" also turns on options DEBUG,
because it does not.  Fixes PR kern/54438.


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.506.2.1 src/share/man/man4/options.4

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



CVS commit: [netbsd-9] src/external/bsd/dhcpcd/dist

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:56:55 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist [netbsd-9]: BUILDING.md Makefile
Makefile.inc configure
src/external/bsd/dhcpcd/dist/compat [netbsd-9]: rb.c rbtree.h
src/external/bsd/dhcpcd/dist/hooks [netbsd-9]: Makefile
src/external/bsd/dhcpcd/dist/src [netbsd-9]: Makefile bpf.c control.c
control.h defs.h dhcp-common.c dhcp.c dhcp6.c dhcpcd.8.in dhcpcd.c
dhcpcd.conf.5.in duid.c if-bsd.c if-linux.c if-options.c
if-options.h if-sun.c if.c if.h ipv4.c ipv4.h ipv6.c ipv6.h
ipv6nd.c ipv6nd.h route.c route.h sa.c script.c

Log Message:
Catch up to current for the following files, requested by roy in ticket #177:

external/bsd/dhcpcd/dist/BUILDING.mdup to 1.1.1.5
external/bsd/dhcpcd/dist/Makefile   up to 1.1.1.7
external/bsd/dhcpcd/dist/Makefile.inc   up to 1.1.1.3
external/bsd/dhcpcd/dist/configure  up to 1.1.1.15
external/bsd/dhcpcd/dist/compat/rb.cup to 1.1.1.2
external/bsd/dhcpcd/dist/compat/rbtree.hup to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/Makefile up to 1.1.1.2
external/bsd/dhcpcd/dist/src/Makefile   up to 1.1.1.6
external/bsd/dhcpcd/dist/src/bpf.c  up to 1.12
external/bsd/dhcpcd/dist/src/control.c  up to 1.1.1.8
external/bsd/dhcpcd/dist/src/control.h  up to 1.1.1.5
external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.27
external/bsd/dhcpcd/dist/src/dhcp-common.c  up to 1.1.1.8
external/bsd/dhcpcd/dist/src/dhcp.c up to 1.25
external/bsd/dhcpcd/dist/src/dhcp6.cup to 1.12
external/bsd/dhcpcd/dist/src/dhcpcd.8.inup to 1.3
external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.25
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.14
external/bsd/dhcpcd/dist/src/duid.c up to 1.1.1.7
external/bsd/dhcpcd/dist/src/if-bsd.c   up to 1.12
external/bsd/dhcpcd/dist/src/if-linux.c up to 1.1.1.16
external/bsd/dhcpcd/dist/src/if-options.c   up to 1.17
external/bsd/dhcpcd/dist/src/if-options.h   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/if-sun.c   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/if.c   up to 1.1.1.16
external/bsd/dhcpcd/dist/src/if.h   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.17
external/bsd/dhcpcd/dist/src/ipv4.h up to 1.1.1.10
external/bsd/dhcpcd/dist/src/ipv6.c up to 1.4
external/bsd/dhcpcd/dist/src/ipv6.h up to 1.5
external/bsd/dhcpcd/dist/src/ipv6nd.c   up to 1.11
external/bsd/dhcpcd/dist/src/ipv6nd.h   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/route.cup to 1.1.1.14
external/bsd/dhcpcd/dist/src/route.hup to 1.1.1.9
external/bsd/dhcpcd/dist/src/sa.c   up to 1.1.1.6
external/bsd/dhcpcd/dist/src/script.c   up to 1.1.1.11

Import dhcpcd-8.0.4 with the following changes:

 * BSD: Fixed router reachability tests
 * inet6: If router unreachable, just solicit a new one
 * inet6: Fon't install a default route if only lladdresses
 * inet6: Stop listening to NA messages
 * BSD: Listen to RTM_MISS messages
 * DHCP: Fix in_cksum for Big Endian
 * DHCP{,6}: Don't log an error if the lease file is truncated

Changes in dhcpcd-8.0.3:

 *  DHCP: Work with IP headers with options
 *  script: Assert that env string are correctly terminated
 *  script: Terminate env strings with no value
 *  script: Don't attempt to use an invalid env string
 *  route: Fix NULL deference error when using static routes
 *  ARP: Respect IFF_NOARP
 *  DHCP: Allow full DHCP support for PtP interfaces, but not by default
 *  control: sends correct buffer to listeners

dhcpcd-ui now correctly reports SSD association and all the addresses
obtained (regression from dhcpcd-7)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.2.1 src/external/bsd/dhcpcd/dist/BUILDING.md
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 src/external/bsd/dhcpcd/dist/Makefile
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.8.1 \
src/external/bsd/dhcpcd/dist/Makefile.inc
cvs rdiff -u -r1.1.1.14 -r1.1.1.14.2.1 src/external/bsd/dhcpcd/dist/configure
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.2.1 src/external/bsd/dhcpcd/dist/compat/rb.c \
src/external/bsd/dhcpcd/dist/compat/rbtree.h
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.20.1 \
src/external/bsd/dhcpcd/dist/hooks/Makefile
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
src/external/bsd/dhcpcd/dist/src/Makefile \
src/external/bsd/dhcpcd/dist/src/sa.c
cvs rdiff -u -r1.11 -r1.11.2.1 src/external/bsd/dhcpcd/dist/src/bpf.c \
  

CVS commit: [netbsd-9] src/external/bsd/dhcpcd/dist

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:56:55 UTC 2019

Modified Files:
src/external/bsd/dhcpcd/dist [netbsd-9]: BUILDING.md Makefile
Makefile.inc configure
src/external/bsd/dhcpcd/dist/compat [netbsd-9]: rb.c rbtree.h
src/external/bsd/dhcpcd/dist/hooks [netbsd-9]: Makefile
src/external/bsd/dhcpcd/dist/src [netbsd-9]: Makefile bpf.c control.c
control.h defs.h dhcp-common.c dhcp.c dhcp6.c dhcpcd.8.in dhcpcd.c
dhcpcd.conf.5.in duid.c if-bsd.c if-linux.c if-options.c
if-options.h if-sun.c if.c if.h ipv4.c ipv4.h ipv6.c ipv6.h
ipv6nd.c ipv6nd.h route.c route.h sa.c script.c

Log Message:
Catch up to current for the following files, requested by roy in ticket #177:

external/bsd/dhcpcd/dist/BUILDING.mdup to 1.1.1.5
external/bsd/dhcpcd/dist/Makefile   up to 1.1.1.7
external/bsd/dhcpcd/dist/Makefile.inc   up to 1.1.1.3
external/bsd/dhcpcd/dist/configure  up to 1.1.1.15
external/bsd/dhcpcd/dist/compat/rb.cup to 1.1.1.2
external/bsd/dhcpcd/dist/compat/rbtree.hup to 1.1.1.2
external/bsd/dhcpcd/dist/hooks/Makefile up to 1.1.1.2
external/bsd/dhcpcd/dist/src/Makefile   up to 1.1.1.6
external/bsd/dhcpcd/dist/src/bpf.c  up to 1.12
external/bsd/dhcpcd/dist/src/control.c  up to 1.1.1.8
external/bsd/dhcpcd/dist/src/control.h  up to 1.1.1.5
external/bsd/dhcpcd/dist/src/defs.h up to 1.1.1.27
external/bsd/dhcpcd/dist/src/dhcp-common.c  up to 1.1.1.8
external/bsd/dhcpcd/dist/src/dhcp.c up to 1.25
external/bsd/dhcpcd/dist/src/dhcp6.cup to 1.12
external/bsd/dhcpcd/dist/src/dhcpcd.8.inup to 1.3
external/bsd/dhcpcd/dist/src/dhcpcd.c   up to 1.25
external/bsd/dhcpcd/dist/src/dhcpcd.conf.5.in   up to 1.1.1.14
external/bsd/dhcpcd/dist/src/duid.c up to 1.1.1.7
external/bsd/dhcpcd/dist/src/if-bsd.c   up to 1.12
external/bsd/dhcpcd/dist/src/if-linux.c up to 1.1.1.16
external/bsd/dhcpcd/dist/src/if-options.c   up to 1.17
external/bsd/dhcpcd/dist/src/if-options.h   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/if-sun.c   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/if.c   up to 1.1.1.16
external/bsd/dhcpcd/dist/src/if.h   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/ipv4.c up to 1.1.1.17
external/bsd/dhcpcd/dist/src/ipv4.h up to 1.1.1.10
external/bsd/dhcpcd/dist/src/ipv6.c up to 1.4
external/bsd/dhcpcd/dist/src/ipv6.h up to 1.5
external/bsd/dhcpcd/dist/src/ipv6nd.c   up to 1.11
external/bsd/dhcpcd/dist/src/ipv6nd.h   up to 1.1.1.11
external/bsd/dhcpcd/dist/src/route.cup to 1.1.1.14
external/bsd/dhcpcd/dist/src/route.hup to 1.1.1.9
external/bsd/dhcpcd/dist/src/sa.c   up to 1.1.1.6
external/bsd/dhcpcd/dist/src/script.c   up to 1.1.1.11

Import dhcpcd-8.0.4 with the following changes:

 * BSD: Fixed router reachability tests
 * inet6: If router unreachable, just solicit a new one
 * inet6: Fon't install a default route if only lladdresses
 * inet6: Stop listening to NA messages
 * BSD: Listen to RTM_MISS messages
 * DHCP: Fix in_cksum for Big Endian
 * DHCP{,6}: Don't log an error if the lease file is truncated

Changes in dhcpcd-8.0.3:

 *  DHCP: Work with IP headers with options
 *  script: Assert that env string are correctly terminated
 *  script: Terminate env strings with no value
 *  script: Don't attempt to use an invalid env string
 *  route: Fix NULL deference error when using static routes
 *  ARP: Respect IFF_NOARP
 *  DHCP: Allow full DHCP support for PtP interfaces, but not by default
 *  control: sends correct buffer to listeners

dhcpcd-ui now correctly reports SSD association and all the addresses
obtained (regression from dhcpcd-7)


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.1.1.4.2.1 src/external/bsd/dhcpcd/dist/BUILDING.md
cvs rdiff -u -r1.1.1.6 -r1.1.1.6.2.1 src/external/bsd/dhcpcd/dist/Makefile
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.8.1 \
src/external/bsd/dhcpcd/dist/Makefile.inc
cvs rdiff -u -r1.1.1.14 -r1.1.1.14.2.1 src/external/bsd/dhcpcd/dist/configure
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.2.1 src/external/bsd/dhcpcd/dist/compat/rb.c \
src/external/bsd/dhcpcd/dist/compat/rbtree.h
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.20.1 \
src/external/bsd/dhcpcd/dist/hooks/Makefile
cvs rdiff -u -r1.1.1.5 -r1.1.1.5.2.1 \
src/external/bsd/dhcpcd/dist/src/Makefile \
src/external/bsd/dhcpcd/dist/src/sa.c
cvs rdiff -u -r1.11 -r1.11.2.1 src/external/bsd/dhcpcd/dist/src/bpf.c \
  

CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:47:02 UTC 2019

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

Log Message:
Ticket #175


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.43 -r1.1.2.44 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.43 src/doc/CHANGES-9.0:1.1.2.44
--- src/doc/CHANGES-9.0:1.1.2.43	Thu Sep  5 08:44:10 2019
+++ src/doc/CHANGES-9.0	Thu Sep  5 08:47:02 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.43 2019/09/05 08:44:10 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.44 2019/09/05 08:47:02 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2786,3 +2786,10 @@ sbin/route/route.c1.163
 	route(8): Show addres for RTM_LOSING.
 	[roy, ticket #172]
 
+tests/net/arp/t_arp.sh1.39
+tests/net/ndp/t_ndp.sh1.36
+
+	Fix ARP and NDP tests for RTM_* messages.
+	Add tests for RTM_MISS.
+	[roy, ticket #175]
+



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:47:02 UTC 2019

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

Log Message:
Ticket #175


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.43 -r1.1.2.44 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/tests/net

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:45:53 UTC 2019

Modified Files:
src/tests/net/arp [netbsd-9]: t_arp.sh
src/tests/net/ndp [netbsd-9]: t_ndp.sh

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

tests/net/arp/t_arp.sh: revision 1.39
tests/net/ndp/t_ndp.sh: revision 1.36

tests: fix ARP and NDP tests for RTM_* messages

While here add tests for RTM_MISS.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.33.2.1 -r1.33.2.2 src/tests/net/ndp/t_ndp.sh

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



CVS commit: [netbsd-9] src/tests/net

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:45:53 UTC 2019

Modified Files:
src/tests/net/arp [netbsd-9]: t_arp.sh
src/tests/net/ndp [netbsd-9]: t_ndp.sh

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

tests/net/arp/t_arp.sh: revision 1.39
tests/net/ndp/t_ndp.sh: revision 1.36

tests: fix ARP and NDP tests for RTM_* messages

While here add tests for RTM_MISS.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.2.1 src/tests/net/arp/t_arp.sh
cvs rdiff -u -r1.33.2.1 -r1.33.2.2 src/tests/net/ndp/t_ndp.sh

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

Modified files:

Index: src/tests/net/arp/t_arp.sh
diff -u src/tests/net/arp/t_arp.sh:1.37 src/tests/net/arp/t_arp.sh:1.37.2.1
--- src/tests/net/arp/t_arp.sh:1.37	Mon May 13 17:55:08 2019
+++ src/tests/net/arp/t_arp.sh	Thu Sep  5 08:45:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_arp.sh,v 1.37 2019/05/13 17:55:08 bad Exp $
+#	$NetBSD: t_arp.sh,v 1.37.2.1 2019/09/05 08:45:53 martin Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -33,6 +33,8 @@ IP4NET=10.0.1.0
 IP4DST=10.0.1.2
 IP4DST_PROXYARP1=10.0.1.3
 IP4DST_PROXYARP2=10.0.1.4
+IP4DST_FAIL1=10.0.1.99
+IP4DST_FAIL2=10.0.99.99
 
 DEBUG=${DEBUG:-false}
 TIMEOUT=1
@@ -718,7 +720,38 @@ arp_rtm_body()
 
 	hdr="RTM_ADD.+"
 	what=""
-	addr="$IP4DST link#2"
+	addr="$IP4DST $macaddr_dst"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) on subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	# arp_maxtries = 5, second between each try
+	atf_check -s exit:2 -o ignore -e ignore \
+		rump.ping -n -w 6 -c 6 $IP4DST_FAIL1
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+"
+	what=""
+	addr="$IP4DST_FAIL1 link#2"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) off subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	atf_check -s exit:2 -o ignore -e ignore \
+		rump.ping -n -w 1 -c 1 $IP4DST_FAIL2
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+"
+	what=""
+	addr="$IP4DST_FAIL2"
 	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
 		cat $file
 

Index: src/tests/net/ndp/t_ndp.sh
diff -u src/tests/net/ndp/t_ndp.sh:1.33.2.1 src/tests/net/ndp/t_ndp.sh:1.33.2.2
--- src/tests/net/ndp/t_ndp.sh:1.33.2.1	Mon Aug 26 14:11:04 2019
+++ src/tests/net/ndp/t_ndp.sh	Thu Sep  5 08:45:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ndp.sh,v 1.33.2.1 2019/08/26 14:11:04 martin Exp $
+#	$NetBSD: t_ndp.sh,v 1.33.2.2 2019/09/05 08:45:53 martin Exp $
 #
 # Copyright (c) 2015 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -31,6 +31,8 @@ IP6SRC=fc00::1
 IP6SRC2=fc00::3
 IP6DST=fc00::2
 IP6NET=fc00::0
+IP6DST_FAIL1=fc00::99
+IP6DST_FAIL2=fc01::99
 
 DEBUG=${DEBUG:-false}
 TIMEOUT=1
@@ -454,7 +456,38 @@ ndp_rtm_body()
 
 	hdr="RTM_ADD.+"
 	what=""
-	addr="$IP6DST link#2"
+	addr="$IP6DST $macaddr_dst"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) on subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	# nd6_mmaxtries = 3, second between each try
+	atf_check -s exit:1 -o ignore -e ignore \
+		rump.ping6 -n -X 3 -c 3 $IP6DST_FAIL1
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+"
+	what=""
+	addr="$IP6DST_FAIL1 link#2"
+	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
+		cat $file
+
+	# Test ping and a resulting routing message (RTM_MISS) off subnet
+	rump.route -n monitor -c 1 > $file &
+	pid=$!
+	sleep 1
+	atf_check -s exit:1 -o ignore -e ignore \
+		rump.ping6 -n -X 1 -c 1 $IP6DST_FAIL2
+	wait $pid
+	$DEBUG && cat $file
+
+	hdr="RTM_MISS.+"
+	what=""
+	addr="$IP6DST_FAIL2"
 	atf_check -s exit:0 -o match:"$hdr" -o match:"$what" -o match:"$addr" \
 		cat $file
 



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:43:42 UTC 2019

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

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

sbin/route/route.c: revision 1.163

route(8): Show addres for RTM_LOSING
While here, add /* FALLTHROUGH */.


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

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



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:44:10 UTC 2019

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

Log Message:
Ticket #172


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:44:10 UTC 2019

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

Log Message:
Ticket #172


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 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.42 src/doc/CHANGES-9.0:1.1.2.43
--- src/doc/CHANGES-9.0:1.1.2.42	Thu Sep  5 08:35:57 2019
+++ src/doc/CHANGES-9.0	Thu Sep  5 08:44:10 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.42 2019/09/05 08:35:57 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.43 2019/09/05 08:44:10 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2781,3 +2781,8 @@ sys/netinet/if_arp.c1.287
 	inet: Send RTM_MISS when we fail to resolve an address.
 	[roy, ticket #170]
 
+sbin/route/route.c1.163
+
+	route(8): Show addres for RTM_LOSING.
+	[roy, ticket #172]
+



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:43:42 UTC 2019

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

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

sbin/route/route.c: revision 1.163

route(8): Show addres for RTM_LOSING
While here, add /* FALLTHROUGH */.


To generate a diff of this commit:
cvs rdiff -u -r1.160.2.2 -r1.160.2.3 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.2 src/sbin/route/route.c:1.160.2.3
--- src/sbin/route/route.c:1.160.2.2	Sun Sep  1 14:13:46 2019
+++ src/sbin/route/route.c	Thu Sep  5 08:43:42 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.160.2.2 2019/09/01 14:13:46 martin Exp $	*/
+/*	$NetBSD: route.c,v 1.160.2.3 2019/09/05 08:43:42 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.2 2019/09/01 14:13:46 martin Exp $");
+__RCSID("$NetBSD: route.c,v 1.160.2.3 2019/09/05 08:43:42 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -1459,10 +1459,11 @@ print_rtmsg(struct rt_msghdr *rtm, int m
 		}
 		printf("\n");
 		break;
-	case RTM_ADD:
-	case RTM_CHANGE:
-	case RTM_DELETE:
-	case RTM_GET:
+	case RTM_ADD:		/* FALLTHROUGH */
+	case RTM_CHANGE:	/* FALLTHROUGH */
+	case RTM_DELETE:	/* FALLTHROUGH */
+	case RTM_GET:		/* FALLTHROUGH */
+	case RTM_LOSING:	/* FALLTHROUGH */
 	case RTM_MISS:
 		(void)printf("pid %d, seq %d, errno %d, flags: ",
 			rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno);



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:35:57 UTC 2019

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

Log Message:
Tickets #168 - #170


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 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.41 src/doc/CHANGES-9.0:1.1.2.42
--- src/doc/CHANGES-9.0:1.1.2.41	Thu Sep  5 08:22:05 2019
+++ src/doc/CHANGES-9.0	Thu Sep  5 08:35:57 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.41 2019/09/05 08:22:05 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.42 2019/09/05 08:35:57 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2762,3 +2762,22 @@ usr.bin/write/write.11.7
 	Richie's v1 manuals, TUHS and CSRG archive.
 	[sevan, ticket #174]
 
+sys/net/rtsock.c1.252
+sys/netinet6/nd6.c1.262
+sys/netinet6/nd6_nbr.c1.168-1.172
+
+	inet6: Send RTM_MISS when we fail to resolve an address.
+	inet6: change rt_announce and a few others to bool in nd6_na_input().
+	[roy, ticket #168]
+
+sys/netinet6/nd6.c1.263
+sys/netinet6/nd6.h1.87
+
+	inet6: Re-introduce ND6_LLINFO_WAITDELETE so we can return EHOSTDOWN.
+	[roy, ticket #169]
+
+sys/netinet/if_arp.c1.287
+
+	inet: Send RTM_MISS when we fail to resolve an address.
+	[roy, ticket #170]
+



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:35:57 UTC 2019

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

Log Message:
Tickets #168 - #170


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.41 -r1.1.2.42 src/doc/CHANGES-9.0

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



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:34:11 UTC 2019

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

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

sys/netinet/if_arp.c: revision 1.287

inet: Send RTM_MISS when we fail to resolve an address.

Takes the same approach as when adding a new address - we no longer
announce the new lladdr right away but we announce the result.

This will either be RTM_ADD or RTM_MISS.
RTM_DELETE is only sent if we have a lladdr assigned OR gc'ed.

This tells us when a new lladdr has been added (RTM_ADD),
changed (RTM_CHANGE), deleted (RTM_DELETED) or has failed to been
resolved (RTM_MISS). The latter case can be interpreted as unreachable.


To generate a diff of this commit:
cvs rdiff -u -r1.282.2.2 -r1.282.2.3 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.



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:34:11 UTC 2019

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

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

sys/netinet/if_arp.c: revision 1.287

inet: Send RTM_MISS when we fail to resolve an address.

Takes the same approach as when adding a new address - we no longer
announce the new lladdr right away but we announce the result.

This will either be RTM_ADD or RTM_MISS.
RTM_DELETE is only sent if we have a lladdr assigned OR gc'ed.

This tells us when a new lladdr has been added (RTM_ADD),
changed (RTM_CHANGE), deleted (RTM_DELETED) or has failed to been
resolved (RTM_MISS). The latter case can be interpreted as unreachable.


To generate a diff of this commit:
cvs rdiff -u -r1.282.2.2 -r1.282.2.3 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.2 src/sys/netinet/if_arp.c:1.282.2.3
--- src/sys/netinet/if_arp.c:1.282.2.2	Sun Sep  1 14:04:37 2019
+++ src/sys/netinet/if_arp.c	Thu Sep  5 08:34:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.282.2.2 2019/09/01 14:04:37 martin Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.282.2.3 2019/09/05 08:34:11 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.2 2019/09/01 14:04:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.282.2.3 2019/09/05 08:34:11 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -308,6 +308,17 @@ arptimer(void *arg)
 	if (lle->la_flags & LLE_LINKED) {
 		size_t pkts_dropped;
 
+		if (lle->la_flags & LLE_VALID) {
+			struct in_addr *in;
+			struct sockaddr_in sin;
+			const char *lladdr;
+
+			in = &lle->r_l3addr.addr4;
+			sockaddr_in_init(&sin, in, 0);
+			lladdr = (const char *)&lle->ll_addr;
+			rt_clonedmsg(RTM_DELETE, sintosa(&sin), lladdr, ifp);
+		}
+
 		LLE_REMREF(lle);
 		pkts_dropped = llentry_free(lle);
 		ARP_STATADD(ARP_STAT_DFRDROPPED, pkts_dropped);
@@ -738,14 +749,8 @@ notfound:
 			rt_unref(_rt);
 		if (la == NULL)
 			ARP_STATINC(ARP_STAT_ALLOCFAIL);
-		else {
-			struct sockaddr_in sin;
-
+		else
 			arp_init_llentry(ifp, la);
-			sockaddr_in_init(&sin, &la->r_l3addr.addr4, 0);
-			if (rt != NULL)
-rt_clonedmsg(RTM_ADD, sintosa(&sin), NULL, ifp);
-		}
 	} else if (LLE_TRY_UPGRADE(la) == 0) {
 		create_lookup = "lookup";
 		LLE_RUNLOCK(la);
@@ -845,9 +850,16 @@ notfound:
 
 	if (renew) {
 		const uint8_t *enaddr = CLLADDR(ifp->if_sadl);
+		struct sockaddr_in sin;
+
 		la->la_expire = time_uptime;
 		arp_settimer(la, arpt_down);
 		la->la_asked++;
+
+		sockaddr_in_init(&sin, &la->r_l3addr.addr4, 0);
+		if (error != EWOULDBLOCK)
+			rt_clonedmsg(RTM_MISS, sintosa(&sin), NULL, ifp);
+
 		LLE_WUNLOCK(la);
 
 		if (rt != NULL) {
@@ -855,11 +867,8 @@ notfound:
 			&satocsin(rt->rt_ifa->ifa_addr)->sin_addr,
 			&satocsin(dst)->sin_addr, enaddr);
 		} else {
-			struct sockaddr_in sin;
 			struct rtentry *_rt;
 
-			sockaddr_in_init(&sin, &la->r_l3addr.addr4, 0);
-
 			/* XXX */
 			_rt = rtalloc1((struct sockaddr *)&sin, 0);
 			if (_rt == NULL)
@@ -1000,7 +1009,7 @@ in_arpinput(struct mbuf *m)
 #endif
 	struct sockaddr sa;
 	struct in_addr isaddr, itaddr, myaddr;
-	int op;
+	int op, rt_cmd;
 	void *tha;
 	uint64_t *arps;
 	struct psref psref, psref_ia;
@@ -1210,7 +1219,9 @@ in_arpinput(struct mbuf *m)
 "for %s by %s\n",
 IN_PRINT(ipbuf, &isaddr), llastr);
 		}
-	}
+		rt_cmd = RTM_CHANGE;
+	} else
+		rt_cmd = la->la_flags & LLE_VALID ? 0 : RTM_ADD;
 
 	KASSERT(ifp->if_sadl->sdl_alen == ifp->if_addrlen);
 
@@ -1252,6 +1263,13 @@ in_arpinput(struct mbuf *m)
 	la->la_asked = 0;
 	/* rt->rt_flags &= ~RTF_REJECT; */
 
+	if (rt_cmd != 0) {
+		struct sockaddr_in sin;
+
+		sockaddr_in_init(&sin, &la->r_l3addr.addr4, 0);
+		rt_clonedmsg(rt_cmd, sintosa(&sin), ar_sha(ah), ifp);
+	}
+
 	if (la->la_hold != NULL) {
 		int n = la->la_numheld;
 		struct mbuf *m_hold, *m_hold_next;



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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:32:34 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-9]: nd6.c nd6.h

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

sys/netinet6/nd6.h: revision 1.87
sys/netinet6/nd6.c: revision 1.263

inet6: Re-introduce ND6_LLINFO_WAITDELETE so we can return EHOSTDOWN

Once we've sent nd6_mmaxtries NS messages, send RTM_MISS and move to the
ND6_LLINFO_WAITDELETE state rather than freeing the llentry right away.
Wait for a probe cycle and then free the llentry.

If a connection attempts to re-use the llentry during ND6_LLINFO_WAITDELETE,
return EHOSTDOWN (or EHOSTUNREACH if a gateway) to match inet behaviour.

Continue to ND6_LLINFO_INCOMPLETE and send another NS probe in hope of a
reply. Rinse and repeat.

This reverts part of nd6.c r1.14 - an 18 year old commit!


To generate a diff of this commit:
cvs rdiff -u -r1.256.2.5 -r1.256.2.6 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.86 -r1.86.6.1 src/sys/netinet6/nd6.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.256.2.5 src/sys/netinet6/nd6.c:1.256.2.6
--- src/sys/netinet6/nd6.c:1.256.2.5	Thu Sep  5 08:28:06 2019
+++ src/sys/netinet6/nd6.c	Thu Sep  5 08:32:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.256.2.5 2019/09/05 08:28:06 martin Exp $	*/
+/*	$NetBSD: nd6.c,v 1.256.2.6 2019/09/05 08:32:34 martin Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256.2.5 2019/09/05 08:28:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256.2.6 2019/09/05 08:32:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -480,9 +480,14 @@ nd6_llinfo_timer(void *arg)
 	ndi = ND_IFINFO(ifp);
 
 	switch (ln->ln_state) {
+	case ND6_LLINFO_WAITDELETE:
+		LLE_REMREF(ln);
+		nd6_free(ln, 0);
+		ln = NULL;
+		break;
+
 	case ND6_LLINFO_INCOMPLETE:
-		if (ln->ln_asked < nd6_mmaxtries) {
-			ln->ln_asked++;
+		if (ln->ln_asked++ < nd6_mmaxtries) {
 			send_ns = true;
 			break;
 		}
@@ -506,9 +511,17 @@ nd6_llinfo_timer(void *arg)
 		sockaddr_in6_init(&sin6, taddr6, 0, 0, 0);
 		rt_clonedmsg(RTM_MISS, sin6tosa(&sin6), NULL, ifp);
 
-		LLE_REMREF(ln);
-		nd6_free(ln, 0);
-		ln = NULL;
+		/*
+		 * Move to the ND6_LLINFO_WAITDELETE state for another
+		 * interval at which point the llentry will be freed
+		 * unless it's attempted to be used again and we'll
+		 * resend NS again, rinse and repeat.
+		 */
+		ln->ln_state = ND6_LLINFO_WAITDELETE;
+		if (ln->ln_asked == nd6_mmaxtries)
+			nd6_llinfo_settimer(ln, ndi->retrans * hz / 1000);
+		else
+			send_ns = true;
 		break;
 
 	case ND6_LLINFO_REACHABLE:
@@ -2312,6 +2325,7 @@ nd6_resolve(struct ifnet *ifp, const str
 	struct llentry *ln = NULL;
 	bool created = false;
 	const struct sockaddr_in6 *dst = satocsin6(_dst);
+	int error;
 
 	/* discard the packet if IPv6 operation is disabled on the interface */
 	if ((ND_IFINFO(ifp)->flags & ND6_IFF_IFDISABLED)) {
@@ -2406,7 +2420,8 @@ nd6_resolve(struct ifnet *ifp, const str
 	 * does not exceed nd6_maxqueuelen.  When it exceeds nd6_maxqueuelen,
 	 * the oldest packet in the queue will be removed.
 	 */
-	if (ln->ln_state == ND6_LLINFO_NOSTATE)
+	if (ln->ln_state == ND6_LLINFO_NOSTATE ||
+	ln->ln_state == ND6_LLINFO_WAITDELETE)
 		ln->ln_state = ND6_LLINFO_INCOMPLETE;
 	if (ln->ln_hold) {
 		struct mbuf *m_hold;
@@ -2430,6 +2445,12 @@ nd6_resolve(struct ifnet *ifp, const str
 		ln->ln_hold = m;
 	}
 
+	if (ln->ln_asked >= nd6_mmaxtries)
+		error = (rt != NULL && rt->rt_flags & RTF_GATEWAY) ?
+		EHOSTUNREACH : EHOSTDOWN;
+	else
+		error = EWOULDBLOCK;
+
 	/*
 	 * If there has been no NS for the neighbor after entering the
 	 * INCOMPLETE state, send the first solicitation.
@@ -2448,7 +2469,7 @@ nd6_resolve(struct ifnet *ifp, const str
 	if (created)
 		nd6_gc_neighbors(LLTABLE6(ifp), &dst->sin6_addr);
 
-	return EWOULDBLOCK;
+	return error;
 }
 
 int

Index: src/sys/netinet6/nd6.h
diff -u src/sys/netinet6/nd6.h:1.86 src/sys/netinet6/nd6.h:1.86.6.1
--- src/sys/netinet6/nd6.h:1.86	Tue Mar  6 10:57:00 2018
+++ src/sys/netinet6/nd6.h	Thu Sep  5 08:32:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.h,v 1.86 2018/03/06 10:57:00 roy Exp $	*/
+/*	$NetBSD: nd6.h,v 1.86.6.1 2019/09/05 08:32:34 martin Exp $	*/
 /*	$KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $	*/
 
 /*
@@ -38,14 +38,7 @@
 
 #define ND6_LLINFO_PURGE	-3
 #define ND6_LLINFO_NOSTATE	-2
-/*
- * We don't need the WAITDELETE state any more, but we keep the definition
- * in a comment line instead of removing it. This is necessary to avoid
- * unintentionally reusing the value for another purpose, which might
- * affect backward compatibility with old applications.
- * (2711 jin...@kame.net)
- */
-/* #define ND6_LLINFO_WAITDELETE	-1 */
+#define ND6_LLI

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

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:32:34 UTC 2019

Modified Files:
src/sys/netinet6 [netbsd-9]: nd6.c nd6.h

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

sys/netinet6/nd6.h: revision 1.87
sys/netinet6/nd6.c: revision 1.263

inet6: Re-introduce ND6_LLINFO_WAITDELETE so we can return EHOSTDOWN

Once we've sent nd6_mmaxtries NS messages, send RTM_MISS and move to the
ND6_LLINFO_WAITDELETE state rather than freeing the llentry right away.
Wait for a probe cycle and then free the llentry.

If a connection attempts to re-use the llentry during ND6_LLINFO_WAITDELETE,
return EHOSTDOWN (or EHOSTUNREACH if a gateway) to match inet behaviour.

Continue to ND6_LLINFO_INCOMPLETE and send another NS probe in hope of a
reply. Rinse and repeat.

This reverts part of nd6.c r1.14 - an 18 year old commit!


To generate a diff of this commit:
cvs rdiff -u -r1.256.2.5 -r1.256.2.6 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.86 -r1.86.6.1 src/sys/netinet6/nd6.h

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



CVS commit: [netbsd-9] src/sys

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:28:06 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: rtsock.c
src/sys/netinet6 [netbsd-9]: nd6.c nd6_nbr.c

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

sys/net/rtsock.c: revision 1.252
sys/netinet6/nd6_nbr.c: revision 1.168 - 1.172
sys/netinet6/nd6.c: revision 1.262

inet6: Send RTM_MISS when we fail to resolve an address.

Takes the same approach as when adding a new address - we no longer
announce the new lladdr right away but we announce the result.

This will either be RTM_ADD or RTM_MISS.
RTM_DELETE is only sent if we have a lladdr assigned OR gc'ed.

This results in less messages via route(4) and tells us when a new
lladdr has been added (RTM_ADD), changed (RTM_CHANGE), deleted
(RTM_DELETED) or has failed to been resolved (RTM_MISS).

The latter case can be interpreted as unreachable.

inet6: change rt_announce and llchange to bool in nd6_na_input()
more bool


To generate a diff of this commit:
cvs rdiff -u -r1.250.2.1 -r1.250.2.2 src/sys/net/rtsock.c
cvs rdiff -u -r1.256.2.4 -r1.256.2.5 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.166.2.1 -r1.166.2.2 src/sys/netinet6/nd6_nbr.c

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



CVS commit: [netbsd-9] src/sys

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:28:06 UTC 2019

Modified Files:
src/sys/net [netbsd-9]: rtsock.c
src/sys/netinet6 [netbsd-9]: nd6.c nd6_nbr.c

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

sys/net/rtsock.c: revision 1.252
sys/netinet6/nd6_nbr.c: revision 1.168 - 1.172
sys/netinet6/nd6.c: revision 1.262

inet6: Send RTM_MISS when we fail to resolve an address.

Takes the same approach as when adding a new address - we no longer
announce the new lladdr right away but we announce the result.

This will either be RTM_ADD or RTM_MISS.
RTM_DELETE is only sent if we have a lladdr assigned OR gc'ed.

This results in less messages via route(4) and tells us when a new
lladdr has been added (RTM_ADD), changed (RTM_CHANGE), deleted
(RTM_DELETED) or has failed to been resolved (RTM_MISS).

The latter case can be interpreted as unreachable.

inet6: change rt_announce and llchange to bool in nd6_na_input()
more bool


To generate a diff of this commit:
cvs rdiff -u -r1.250.2.1 -r1.250.2.2 src/sys/net/rtsock.c
cvs rdiff -u -r1.256.2.4 -r1.256.2.5 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.166.2.1 -r1.166.2.2 src/sys/netinet6/nd6_nbr.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/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.250.2.1 src/sys/net/rtsock.c:1.250.2.2
--- src/sys/net/rtsock.c:1.250.2.1	Mon Aug 26 13:42:36 2019
+++ src/sys/net/rtsock.c	Thu Sep  5 08:28:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.250.2.1 2019/08/26 13:42:36 martin Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.250.2.2 2019/09/05 08:28:05 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.250.2.1 2019/08/26 13:42:36 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.250.2.2 2019/09/05 08:28:05 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -152,21 +152,21 @@ rt_clonedmsg(int type, const struct sock
 	/* Mimic flags exactly */
 #define RTF_LLINFO	0x400
 #define RTF_CLONED	0x2000
-	int flags = RTF_HOST | RTF_DONE | RTF_LLINFO | RTF_CLONED;
+	int flags = RTF_DONE;
 	union {
 		struct sockaddr sa;
 		struct sockaddr_storage ss;
 		struct sockaddr_dl sdl;
 	} u;
-	uint8_t namelen = strlen(ifp->if_xname);
-	uint8_t addrlen = ifp->if_addrlen;
 
-	if (type != RTM_DELETE)
+	if (type != RTM_MISS)
+		flags |= RTF_HOST | RTF_CLONED | RTF_LLINFO;
+	if (type == RTM_ADD || type == RTM_CHANGE)
 		flags |= RTF_UP;
 	memset(&info, 0, sizeof(info));
 	info.rti_info[RTAX_DST] = dst;
 	sockaddr_dl_init(&u.sdl, sizeof(u.ss), ifp->if_index, ifp->if_type,
-	NULL, namelen, lladdr, addrlen);
+	NULL, 0, lladdr, ifp->if_addrlen);
 	info.rti_info[RTAX_GATEWAY] = &u.sa;
 
 	rt_missmsg(type, &info, flags, 0);

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.256.2.4 src/sys/netinet6/nd6.c:1.256.2.5
--- src/sys/netinet6/nd6.c:1.256.2.4	Sun Sep  1 14:06:22 2019
+++ src/sys/netinet6/nd6.c	Thu Sep  5 08:28:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.256.2.4 2019/09/01 14:06:22 martin Exp $	*/
+/*	$NetBSD: nd6.c,v 1.256.2.5 2019/09/05 08:28:06 martin Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256.2.4 2019/09/01 14:06:22 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256.2.5 2019/09/05 08:28:06 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -461,6 +461,8 @@ nd6_llinfo_timer(void *arg)
 	struct nd_ifinfo *ndi = NULL;
 	bool send_ns = false;
 	const struct in6_addr *daddr6 = NULL;
+	const struct in6_addr *taddr6 = &ln->r_l3addr.addr6;
+	struct sockaddr_in6 sin6;
 
 	SOFTNET_KERNEL_LOCK_UNLESS_NET_MPSAFE();
 
@@ -472,7 +474,6 @@ nd6_llinfo_timer(void *arg)
 		goto out;
 	}
 
-
 	ifp = ln->lle_tbl->llt_ifp;
 	KASSERT(ifp != NULL);
 
@@ -483,29 +484,33 @@ nd6_llinfo_timer(void *arg)
 		if (ln->ln_asked < nd6_mmaxtries) {
 			ln->ln_asked++;
 			send_ns = true;
-		} else {
-			struct mbuf *m = ln->ln_hold;
-			if (m) {
-struct mbuf *m0;
+			break;
+		}
 
-/*
- * assuming every packet in ln_hold has
- * the same IP header
- */
-m0 = m->m_nextpkt;
-m->m_nextpkt = NULL;
-ln->ln_hold = m0;
-clear_llinfo_pqueue(ln);
- 			}
-			LLE_REMREF(ln);
-			nd6_free(ln, 0);
-			ln = NULL;
-			if (m != NULL) {
-icmp6_error2(m, ICMP6_DST_UNREACH,
-ICMP6_DST_UNREACH_ADDR, 0, ifp);
-			}
+		if (ln->ln_hold) {
+			struct mbuf *m = ln->ln_hold, *m0;
+
+			/*
+			 * assuming every packet in ln_hold has
+			 * the same IP header
+			 */
+			m0 = m->m_nextpkt;
+			m->m_nextpkt = NULL;
+			ln->ln_hold = m0;
+			clear_llinfo_pqueue(ln);
+
+			icmp6_error2(m, ICMP6_DST_UNREACH,
+			ICMP6_DST_UNREACH_ADDR, 0, ifp);
 		}
+
+		sockaddr_in6_init(&sin6, taddr6, 0, 0, 0);
+		rt_clon

CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:22:05 UTC 2019

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

Log Message:
Ticket #174


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 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.40 src/doc/CHANGES-9.0:1.1.2.41
--- src/doc/CHANGES-9.0:1.1.2.40	Thu Sep  5 03:40:57 2019
+++ src/doc/CHANGES-9.0	Thu Sep  5 08:22:05 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.40 2019/09/05 03:40:57 msaitoh Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.41 2019/09/05 08:22:05 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2710,3 +2710,55 @@ distrib/ews4800mips/floppies/ramdisk/Mak
 
 	Use the non wide char libcurses version for the ramdisk to save space.
 	[martin, ticket #176]
+games/bcd/bcd.6	1.18,1.19
+lib/libc/compat-43/creat.3			1.17
+lib/libc/gen/exec.31.30,1.31
+lib/libc/stdio/fopen.31.36
+lib/libc/stdio/getc.31.13
+lib/libc/stdio/putc.31.14
+lib/libc/stdlib/exit.31.17
+lib/libc/sys/chdir.21.23
+lib/libc/sys/chmod.21.48
+lib/libc/sys/chown.21.37
+lib/libc/sys/close.21.18
+lib/libc/sys/fork.21.25
+lib/libc/sys/getuid.21.18
+lib/libc/sys/link.21.33
+lib/libc/sys/lseek.21.25
+lib/libc/sys/mkdir.21.30
+lib/libc/sys/mount.21.51
+lib/libc/sys/open.21.60
+lib/libc/sys/read.21.39
+lib/libc/sys/setuid.21.23
+lib/libc/sys/stat.21.59
+lib/libc/sys/unlink.21.30
+lib/libc/sys/wait.21.40
+lib/libc/sys/write.21.36
+lib/libc/time/ctime.31.61
+lib/libcompat/4.1/stty.3			1.10
+lib/libm/man/cos.31.17
+lib/libm/man/exp.31.32
+lib/libm/man/log.31.7
+lib/libm/man/sin.31.15
+sbin/init/init.81.61,1.62
+share/man/man5/passwd.51.34
+share/man/man5/utmp.51.17
+share/man/man9/copy.91.22
+share/man/man9/intro.91.26
+share/man/man9/uiomove.9			1.20
+usr.bin/dc/dc.1	1.3
+usr.bin/du/du.1	1.24
+usr.bin/mail/mail.11.66,1.67
+usr.bin/mesg/mesg.11.11
+usr.bin/pr/pr.1	1.24
+usr.bin/sort/sort.11.40
+usr.bin/su/su.1	1.53,1.54
+usr.bin/tty/tty.11.10
+usr.bin/wc/wc.1	1.18
+usr.bin/who/who.11.25
+usr.bin/write/write.11.7
+
+	Adjust or add history information based on information from Dennis
+	Richie's v1 manuals, TUHS and CSRG archive.
+	[sevan, ticket #174]
+



CVS commit: [netbsd-9] src/doc

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:22:05 UTC 2019

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

Log Message:
Ticket #174


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:19:43 UTC 2019

Modified Files:
src/games/bcd [netbsd-9]: bcd.6
src/lib/libc/compat-43 [netbsd-9]: creat.3
src/lib/libc/gen [netbsd-9]: exec.3
src/lib/libc/stdio [netbsd-9]: fopen.3 getc.3 putc.3
src/lib/libc/stdlib [netbsd-9]: exit.3
src/lib/libc/sys [netbsd-9]: chdir.2 chmod.2 chown.2 close.2 fork.2
getuid.2 link.2 lseek.2 mkdir.2 mount.2 open.2 read.2 setuid.2
stat.2 unlink.2 wait.2 write.2
src/lib/libc/time [netbsd-9]: ctime.3
src/lib/libcompat/4.1 [netbsd-9]: stty.3
src/lib/libm/man [netbsd-9]: cos.3 exp.3 log.3 sin.3
src/sbin/init [netbsd-9]: init.8
src/share/man/man5 [netbsd-9]: passwd.5 utmp.5
src/share/man/man9 [netbsd-9]: copy.9 intro.9 uiomove.9
src/usr.bin/dc [netbsd-9]: dc.1
src/usr.bin/du [netbsd-9]: du.1
src/usr.bin/mail [netbsd-9]: mail.1
src/usr.bin/mesg [netbsd-9]: mesg.1
src/usr.bin/pr [netbsd-9]: pr.1
src/usr.bin/sort [netbsd-9]: sort.1
src/usr.bin/su [netbsd-9]: su.1
src/usr.bin/tty [netbsd-9]: tty.1
src/usr.bin/wc [netbsd-9]: wc.1
src/usr.bin/who [netbsd-9]: who.1
src/usr.bin/write [netbsd-9]: write.1

Log Message:
Pull up following revision(s) (requested by sevan in ticket #174):
lib/libc/sys/chmod.2: revision 1.48
lib/libc/sys/stat.2: revision 1.59
lib/libc/sys/unlink.2: revision 1.30
lib/libc/sys/lseek.2: revision 1.25
lib/libc/sys/getuid.2: revision 1.18
lib/libc/sys/chown.2: revision 1.37
lib/libm/man/exp.3: revision 1.32
lib/libm/man/log.3: revision 1.7
lib/libc/sys/open.2: revision 1.60
lib/libc/stdio/fopen.3: revision 1.36
lib/libc/stdio/putc.3: revision 1.14
lib/libc/sys/mount.2: revision 1.51
share/man/man9/copy.9: revision 1.22
share/man/man9/uiomove.9: revision 1.20
lib/libc/sys/setuid.2: revision 1.23
lib/libc/sys/close.2: revision 1.18
sbin/init/init.8: revision 1.61
lib/libc/sys/write.2: revision 1.36
lib/libc/sys/read.2: revision 1.39
sbin/init/init.8: revision 1.62
lib/libc/sys/wait.2: revision 1.40
usr.bin/tty/tty.1: revision 1.10
lib/libc/sys/link.2: revision 1.33
usr.bin/du/du.1: revision 1.24
lib/libc/stdlib/exit.3: revision 1.17
usr.bin/su/su.1: revision 1.53
usr.bin/mail/mail.1: revision 1.66
lib/libc/sys/fork.2: revision 1.25
usr.bin/su/su.1: revision 1.54
usr.bin/mail/mail.1: revision 1.67
lib/libm/man/sin.3: revision 1.15
share/man/man9/intro.9: revision 1.26
share/man/man5/utmp.5: revision 1.17
lib/libc/compat-43/creat.3: revision 1.17
lib/libc/time/ctime.3: revision 1.61
lib/libcompat/4.1/stty.3: revision 1.10
usr.bin/dc/dc.1: revision 1.3
lib/libm/man/cos.3: revision 1.17
lib/libc/sys/chdir.2: revision 1.23
lib/libc/gen/exec.3: revision 1.30
lib/libc/gen/exec.3: revision 1.31
games/bcd/bcd.6: revision 1.18
games/bcd/bcd.6: revision 1.19
usr.bin/write/write.1: revision 1.7
usr.bin/wc/wc.1: revision 1.18
usr.bin/pr/pr.1: revision 1.24
usr.bin/who/who.1: revision 1.25
lib/libc/sys/mkdir.2: revision 1.30
lib/libc/stdio/getc.3: revision 1.13
usr.bin/sort/sort.1: revision 1.40
usr.bin/mesg/mesg.1: revision 1.11
share/man/man5/passwd.5: revision 1.34
sort was there since v1
https://www.bell-labs.com/usr/dmr/www/man61.pdf

dc was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

du was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mail was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mesg was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

su was in v1
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man14.pdf
Update URL

write was in v1
https://www.bell-labs.com/usr/dmr/www/man14.pdf
grammar

passwd(5) was in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

utmp(5) was present in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

Earliest version of wtmp I could find was in v3
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man5/wtmp.5

Document history of chdir(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chmod(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chown(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

create was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of exec()
Move statement on execlpe()

CVS commit: [netbsd-9] src

2019-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  5 08:19:43 UTC 2019

Modified Files:
src/games/bcd [netbsd-9]: bcd.6
src/lib/libc/compat-43 [netbsd-9]: creat.3
src/lib/libc/gen [netbsd-9]: exec.3
src/lib/libc/stdio [netbsd-9]: fopen.3 getc.3 putc.3
src/lib/libc/stdlib [netbsd-9]: exit.3
src/lib/libc/sys [netbsd-9]: chdir.2 chmod.2 chown.2 close.2 fork.2
getuid.2 link.2 lseek.2 mkdir.2 mount.2 open.2 read.2 setuid.2
stat.2 unlink.2 wait.2 write.2
src/lib/libc/time [netbsd-9]: ctime.3
src/lib/libcompat/4.1 [netbsd-9]: stty.3
src/lib/libm/man [netbsd-9]: cos.3 exp.3 log.3 sin.3
src/sbin/init [netbsd-9]: init.8
src/share/man/man5 [netbsd-9]: passwd.5 utmp.5
src/share/man/man9 [netbsd-9]: copy.9 intro.9 uiomove.9
src/usr.bin/dc [netbsd-9]: dc.1
src/usr.bin/du [netbsd-9]: du.1
src/usr.bin/mail [netbsd-9]: mail.1
src/usr.bin/mesg [netbsd-9]: mesg.1
src/usr.bin/pr [netbsd-9]: pr.1
src/usr.bin/sort [netbsd-9]: sort.1
src/usr.bin/su [netbsd-9]: su.1
src/usr.bin/tty [netbsd-9]: tty.1
src/usr.bin/wc [netbsd-9]: wc.1
src/usr.bin/who [netbsd-9]: who.1
src/usr.bin/write [netbsd-9]: write.1

Log Message:
Pull up following revision(s) (requested by sevan in ticket #174):
lib/libc/sys/chmod.2: revision 1.48
lib/libc/sys/stat.2: revision 1.59
lib/libc/sys/unlink.2: revision 1.30
lib/libc/sys/lseek.2: revision 1.25
lib/libc/sys/getuid.2: revision 1.18
lib/libc/sys/chown.2: revision 1.37
lib/libm/man/exp.3: revision 1.32
lib/libm/man/log.3: revision 1.7
lib/libc/sys/open.2: revision 1.60
lib/libc/stdio/fopen.3: revision 1.36
lib/libc/stdio/putc.3: revision 1.14
lib/libc/sys/mount.2: revision 1.51
share/man/man9/copy.9: revision 1.22
share/man/man9/uiomove.9: revision 1.20
lib/libc/sys/setuid.2: revision 1.23
lib/libc/sys/close.2: revision 1.18
sbin/init/init.8: revision 1.61
lib/libc/sys/write.2: revision 1.36
lib/libc/sys/read.2: revision 1.39
sbin/init/init.8: revision 1.62
lib/libc/sys/wait.2: revision 1.40
usr.bin/tty/tty.1: revision 1.10
lib/libc/sys/link.2: revision 1.33
usr.bin/du/du.1: revision 1.24
lib/libc/stdlib/exit.3: revision 1.17
usr.bin/su/su.1: revision 1.53
usr.bin/mail/mail.1: revision 1.66
lib/libc/sys/fork.2: revision 1.25
usr.bin/su/su.1: revision 1.54
usr.bin/mail/mail.1: revision 1.67
lib/libm/man/sin.3: revision 1.15
share/man/man9/intro.9: revision 1.26
share/man/man5/utmp.5: revision 1.17
lib/libc/compat-43/creat.3: revision 1.17
lib/libc/time/ctime.3: revision 1.61
lib/libcompat/4.1/stty.3: revision 1.10
usr.bin/dc/dc.1: revision 1.3
lib/libm/man/cos.3: revision 1.17
lib/libc/sys/chdir.2: revision 1.23
lib/libc/gen/exec.3: revision 1.30
lib/libc/gen/exec.3: revision 1.31
games/bcd/bcd.6: revision 1.18
games/bcd/bcd.6: revision 1.19
usr.bin/write/write.1: revision 1.7
usr.bin/wc/wc.1: revision 1.18
usr.bin/pr/pr.1: revision 1.24
usr.bin/who/who.1: revision 1.25
lib/libc/sys/mkdir.2: revision 1.30
lib/libc/stdio/getc.3: revision 1.13
usr.bin/sort/sort.1: revision 1.40
usr.bin/mesg/mesg.1: revision 1.11
share/man/man5/passwd.5: revision 1.34
sort was there since v1
https://www.bell-labs.com/usr/dmr/www/man61.pdf

dc was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

du was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mail was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

mesg was in v1
https://www.bell-labs.com/usr/dmr/www/man12.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

su was in v1
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man13.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man14.pdf
Update URL

write was in v1
https://www.bell-labs.com/usr/dmr/www/man14.pdf
grammar

passwd(5) was in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

utmp(5) was present in v1
https://www.bell-labs.com/usr/dmr/www/man51.pdf

Earliest version of wtmp I could find was in v3
https://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man5/wtmp.5

Document history of chdir(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chmod(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of chown(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf

create was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf

Document history of exec()
Move statement on execlpe()

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

2019-09-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep  5 08:06:51 UTC 2019

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

Log Message:
 Fix a bug that MBSDC (Bad SFD Count) isn't counted on X550EM_X and X550EM_A.
The register is for X550 and newer.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.208 src/sys/dev/pci/ixgbe/ixgbe.c:1.209
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.208	Wed Sep  4 08:13:43 2019
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu Sep  5 08:06:51 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.208 2019/09/04 08:13:43 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.209 2019/09/05 08:06:51 msaitoh Exp $ */
 
 /**
 
@@ -1571,7 +1571,7 @@ ixgbe_update_stats_counters(struct adapt
 	stats->illerrc.ev_count += IXGBE_READ_REG(hw, IXGBE_ILLERRC);
 	stats->errbc.ev_count += IXGBE_READ_REG(hw, IXGBE_ERRBC);
 	stats->mspdc.ev_count += IXGBE_READ_REG(hw, IXGBE_MSPDC);
-	if (hw->mac.type == ixgbe_mac_X550)
+	if (hw->mac.type >= ixgbe_mac_X550)
 		stats->mbsdc.ev_count += IXGBE_READ_REG(hw, IXGBE_MBSDC);
 
 	/* 16 registers exist */
@@ -2126,7 +2126,8 @@ ixgbe_clear_evcnt(struct adapter *adapte
 	stats->illerrc.ev_count = 0;
 	stats->errbc.ev_count = 0;
 	stats->mspdc.ev_count = 0;
-	stats->mbsdc.ev_count = 0;
+	if (hw->mac.type >= ixgbe_mac_X550)
+		stats->mbsdc.ev_count = 0;
 	stats->mpctotal.ev_count = 0;
 	stats->mlfc.ev_count = 0;
 	stats->mrfc.ev_count = 0;



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

2019-09-05 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep  5 08:06:51 UTC 2019

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

Log Message:
 Fix a bug that MBSDC (Bad SFD Count) isn't counted on X550EM_X and X550EM_A.
The register is for X550 and newer.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/sys/dev/pci/ixgbe/ixgbe.c

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