CVS commit: [netbsd-9] src/doc

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:13:29 UTC 2021

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

Log Message:
Tickets #1347 and #1348


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/doc/CHANGES-9.3

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.3
diff -u src/doc/CHANGES-9.3:1.1.2.30 src/doc/CHANGES-9.3:1.1.2.31
--- src/doc/CHANGES-9.3:1.1.2.30	Wed Sep 15 16:32:30 2021
+++ src/doc/CHANGES-9.3	Thu Sep 23 10:13:28 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.30 2021/09/15 16:32:30 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.31 2021/09/23 10:13:28 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -730,3 +730,14 @@ share/man/man4/ixv.41.8
 	- Fix typos.
 	[msaitoh, ticket #1346]
 
+bin/mkdir/mkdir.c1.39
+
+	mkdir(1): PR 56398: fix mode of final component of paths when -m
+	is used.
+	[kre, ticket #1347]
+
+bin/cp/utils.c	1.47
+
+	cp(1): PR 54564: cp of a fifo yields an empty file.
+	[skrll, ticket #1348]
+



CVS commit: [netbsd-9] src/doc

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:13:29 UTC 2021

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

Log Message:
Tickets #1347 and #1348


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src/bin/cp

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:11:02 UTC 2021

Modified Files:
src/bin/cp [netbsd-9]: utils.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1348):

bin/cp/utils.c: revision 1.47

PR/54564: Jan Schaumann: cp of a fifo yields an empty file

Don't short-circuit 0 sized stat entries if they don't belong to regular
files.

Also don't try to mmap non-regular files.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.2.1 src/bin/cp/utils.c

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

Modified files:

Index: src/bin/cp/utils.c
diff -u src/bin/cp/utils.c:1.46 src/bin/cp/utils.c:1.46.2.1
--- src/bin/cp/utils.c:1.46	Tue Jul 17 13:04:58 2018
+++ src/bin/cp/utils.c	Thu Sep 23 10:11:02 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: utils.c,v 1.46 2018/07/17 13:04:58 darcy Exp $ */
+/* $NetBSD: utils.c,v 1.46.2.1 2021/09/23 10:11:02 martin Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)utils.c	8.3 (Berkeley) 4/1/94";
 #else
-__RCSID("$NetBSD: utils.c,v 1.46 2018/07/17 13:04:58 darcy Exp $");
+__RCSID("$NetBSD: utils.c,v 1.46.2.1 2021/09/23 10:11:02 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -174,87 +174,83 @@ copy_file(FTSENT *entp, int dne)
 
 	rval = 0;
 
-	/*
+	/* 
 	 * There's no reason to do anything other than close the file
-	 * now if it's empty, so let's not bother.
+	 * now if it's regular and empty, so let's not bother.
 	 */
-	if (fs->st_size > 0) {
-		struct finfo fi;
-
-		fi.from = entp->fts_path;
-		fi.to = to.p_path;
-		fi.size = fs->st_size;
-
-		/*
-		 * Mmap and write if less than 8M (the limit is so
-		 * we don't totally trash memory on big files).
-		 * This is really a minor hack, but it wins some CPU back.
-		 */
-		bool use_read;
+	bool need_copy = !S_ISREG(fs->st_mode) || fs->st_size > 0;
 
-		use_read = true;
-		if (fs->st_size <= MMAP_MAX_SIZE) {
-			size_t fsize = (size_t)fs->st_size;
-			p = mmap(NULL, fsize, PROT_READ, MAP_FILE|MAP_SHARED,
-			from_fd, (off_t)0);
-			if (p != MAP_FAILED) {
-size_t remainder;
-
-use_read = false;
-
-(void) madvise(p, (size_t)fs->st_size,
- MADV_SEQUENTIAL);
-
-/*
- * Write out the data in small chunks to
- * avoid locking the output file for a
- * long time if the reading the data from
- * the source is slow.
- */
-remainder = fsize;
-do {
-	ssize_t chunk;
-
-	chunk = (remainder > MMAP_MAX_WRITE) ?
-	MMAP_MAX_WRITE : remainder;
-	if (write(to_fd, [fsize - remainder],
-	chunk) != chunk) {
-		warn("%s", to.p_path);
-		rval = 1;
-		break;
-	}
-	remainder -= chunk;
-	ptotal += chunk;
-	if (pinfo)
-		progress(, ptotal);
-} while (remainder > 0);
+	struct finfo fi;
 
-if (munmap(p, fsize) < 0) {
-	warn("%s", entp->fts_path);
-	rval = 1;
-}
-			}
-		}
+	fi.from = entp->fts_path;
+	fi.to = to.p_path;
+	fi.size = fs->st_size;
 
-		if (use_read) {
-			while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) {
-wcount = write(to_fd, buf, (size_t)rcount);
-if (rcount != wcount || wcount == -1) {
+	/*
+	 * Mmap and write if less than 8M (the limit is so
+	 * we don't totally trash memory on big files).
+	 * This is really a minor hack, but it wins some CPU back.
+	 */
+	if (S_ISREG(fs->st_mode) && fs->st_size && fs->st_size <= MMAP_MAX_SIZE) {
+		size_t fsize = (size_t)fs->st_size;
+		p = mmap(NULL, fsize, PROT_READ, MAP_FILE|MAP_SHARED,
+		from_fd, (off_t)0);
+		if (p != MAP_FAILED) {
+			size_t remainder;
+
+			need_copy = false;
+
+			(void) madvise(p, (size_t)fs->st_size, MADV_SEQUENTIAL);
+
+			/*
+			 * Write out the data in small chunks to
+			 * avoid locking the output file for a
+			 * long time if the reading the data from
+			 * the source is slow.
+			 */
+			remainder = fsize;
+			do {
+ssize_t chunk;
+
+chunk = (remainder > MMAP_MAX_WRITE) ?
+MMAP_MAX_WRITE : remainder;
+if (write(to_fd, [fsize - remainder],
+chunk) != chunk) {
 	warn("%s", to.p_path);
 	rval = 1;
 	break;
 }
-ptotal += wcount;
+remainder -= chunk;
+ptotal += chunk;
 if (pinfo)
 	progress(, ptotal);
-			}
-			if (rcount < 0) {
+			} while (remainder > 0);
+
+			if (munmap(p, fsize) < 0) {
 warn("%s", entp->fts_path);
 rval = 1;
 			}
 		}
 	}
 
+	if (need_copy) {
+		while ((rcount = read(from_fd, buf, MAXBSIZE)) > 0) {
+			wcount = write(to_fd, buf, (size_t)rcount);
+			if (rcount != wcount || wcount == -1) {
+warn("%s", to.p_path);
+rval = 1;
+break;
+			}
+			ptotal += wcount;
+			if (pinfo)
+progress(, ptotal);
+		}
+		if (rcount < 0) {
+			warn("%s", entp->fts_path);
+			rval = 1;
+		}
+	}
+
 	if (pflag && (fcpxattr(from_fd, to_fd) != 0))
 		warn("%s: error copying extended attributes", to.p_path);
 



CVS commit: [netbsd-9] src/bin/cp

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:11:02 UTC 2021

Modified Files:
src/bin/cp [netbsd-9]: utils.c

Log Message:
Pull up following revision(s) (requested by skrll in ticket #1348):

bin/cp/utils.c: revision 1.47

PR/54564: Jan Schaumann: cp of a fifo yields an empty file

Don't short-circuit 0 sized stat entries if they don't belong to regular
files.

Also don't try to mmap non-regular files.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.2.1 src/bin/cp/utils.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/bin/mkdir

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:09:20 UTC 2021

Modified Files:
src/bin/mkdir [netbsd-9]: mkdir.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1347):

bin/mkdir/mkdir.c: revision 1.39

PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.46.1 src/bin/mkdir/mkdir.c

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

Modified files:

Index: src/bin/mkdir/mkdir.c
diff -u src/bin/mkdir/mkdir.c:1.38 src/bin/mkdir/mkdir.c:1.38.46.1
--- src/bin/mkdir/mkdir.c:1.38	Mon Aug 29 14:45:28 2011
+++ src/bin/mkdir/mkdir.c	Thu Sep 23 10:09:20 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $ */
+/* $NetBSD: mkdir.c,v 1.38.46.1 2021/09/23 10:09:20 martin Exp $ */
 
 /*
  * Copyright (c) 1983, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)mkdir.c	8.2 (Berkeley) 1/25/94";
 #else
-__RCSID("$NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $");
+__RCSID("$NetBSD: mkdir.c,v 1.38.46.1 2021/09/23 10:09:20 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -162,7 +162,7 @@ mkpath(char *path, mode_t mode, mode_t d
 		slash += strspn(slash, "/");
 		slash += strcspn(slash, "/");
 
-		done = (*slash == '\0');
+		done = (*(slash + strspn(slash, "/")) == '\0');
 		*slash = '\0';
 
 		rv = mkdir(path, done ? mode : dir_mode);



CVS commit: [netbsd-9] src/bin/mkdir

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:09:20 UTC 2021

Modified Files:
src/bin/mkdir [netbsd-9]: mkdir.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1347):

bin/mkdir/mkdir.c: revision 1.39

PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.46.1 src/bin/mkdir/mkdir.c

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



CVS commit: [netbsd-8] src/doc

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:08:35 UTC 2021

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

Log Message:
Ticket #1697


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.102 -r1.1.2.103 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/doc

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:08:35 UTC 2021

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

Log Message:
Ticket #1697


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.102 -r1.1.2.103 src/doc/CHANGES-8.3

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.3
diff -u src/doc/CHANGES-8.3:1.1.2.102 src/doc/CHANGES-8.3:1.1.2.103
--- src/doc/CHANGES-8.3:1.1.2.102	Wed Sep 15 16:39:19 2021
+++ src/doc/CHANGES-8.3	Thu Sep 23 10:08:35 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.102 2021/09/15 16:39:19 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.103 2021/09/23 10:08:35 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2109,3 +2109,10 @@ share/man/man4/ixv.41.8
 	- KNF.
 	- Fix typos.
 	[msaitoh, ticket #1696]
+
+bin/mkdir/mkdir.c1.39
+
+	mkdir(1): PR 56398: fix mode of final component of paths when -m
+	is used.
+	[kre, ticket #1697]
+



CVS commit: [netbsd-8] src/bin/mkdir

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:04:53 UTC 2021

Modified Files:
src/bin/mkdir [netbsd-8]: mkdir.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1697):

bin/mkdir/mkdir.c: revision 1.39

PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.36.1 src/bin/mkdir/mkdir.c

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

Modified files:

Index: src/bin/mkdir/mkdir.c
diff -u src/bin/mkdir/mkdir.c:1.38 src/bin/mkdir/mkdir.c:1.38.36.1
--- src/bin/mkdir/mkdir.c:1.38	Mon Aug 29 14:45:28 2011
+++ src/bin/mkdir/mkdir.c	Thu Sep 23 10:04:53 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $ */
+/* $NetBSD: mkdir.c,v 1.38.36.1 2021/09/23 10:04:53 martin Exp $ */
 
 /*
  * Copyright (c) 1983, 1992, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)mkdir.c	8.2 (Berkeley) 1/25/94";
 #else
-__RCSID("$NetBSD: mkdir.c,v 1.38 2011/08/29 14:45:28 joerg Exp $");
+__RCSID("$NetBSD: mkdir.c,v 1.38.36.1 2021/09/23 10:04:53 martin Exp $");
 #endif
 #endif /* not lint */
 
@@ -162,7 +162,7 @@ mkpath(char *path, mode_t mode, mode_t d
 		slash += strspn(slash, "/");
 		slash += strcspn(slash, "/");
 
-		done = (*slash == '\0');
+		done = (*(slash + strspn(slash, "/")) == '\0');
 		*slash = '\0';
 
 		rv = mkdir(path, done ? mode : dir_mode);



CVS commit: [netbsd-8] src/bin/mkdir

2021-09-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep 23 10:04:53 UTC 2021

Modified Files:
src/bin/mkdir [netbsd-8]: mkdir.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1697):

bin/mkdir/mkdir.c: revision 1.39

PR bin/56398

The final component of both a/b/c and a/b/c/ is "c", so that's the one
to which the -m arg applies.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.38.36.1 src/bin/mkdir/mkdir.c

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



CVS commit: [netbsd-8] src/doc

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:39:19 UTC 2021

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

Log Message:
Ticket #1696


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.101 -r1.1.2.102 src/doc/CHANGES-8.3

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.3
diff -u src/doc/CHANGES-8.3:1.1.2.101 src/doc/CHANGES-8.3:1.1.2.102
--- src/doc/CHANGES-8.3:1.1.2.101	Wed Sep 15 16:34:29 2021
+++ src/doc/CHANGES-8.3	Wed Sep 15 16:39:19 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.101 2021/09/15 16:34:29 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.102 2021/09/15 16:39:19 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2023,3 +2023,89 @@ build.sh	1.348-1.352, 1.356
 	Support for MKREPRO and automatic timestamps when the source
 	tree is from git or mercurial.
 	[martin, ticket #1695]
+
+sys/dev/pci/ixgbe/ixgbe.c			1.252, 1.280-1.283, 1.286-1.287, 1.289-1.290 via patch
+sys/dev/pci/ixgbe/ixgbe.h			1.73, 1.76-1.80 via patch
+sys/dev/pci/ixgbe/ix_txrx.c			1.68-1.93
+sys/dev/pci/ixgbe/ixv.c1.153, 1.157-1.161, 1.163-1.166 via patch
+sys/dev/pci/ixgbe/if_bypass.c			1.7-1.9
+sys/dev/pci/ixgbe/if_fdir.c			1.4-1.5
+sys/dev/pci/ixgbe/if_sriov.c			1.10-1.11
+sys/dev/pci/ixgbe/ixgbe_82598.c			1.16
+sys/dev/pci/ixgbe/ixgbe_82599.c			1.23
+sys/dev/pci/ixgbe/ixgbe_api.c			1.25
+sys/dev/pci/ixgbe/ixgbe_bypass.h		1.2
+sys/dev/pci/ixgbe/ixgbe_common.c		1.30-1.33
+sys/dev/pci/ixgbe/ixgbe_dcb.c			1.10-1.11
+sys/dev/pci/ixgbe/ixgbe_dcb.h			1.7
+sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.8-1.9
+sys/dev/pci/ixgbe/ixgbe_dcb_82598.h		1.7
+sys/dev/pci/ixgbe/ixgbe_dcb_82599.c		1.8-1.9
+sys/dev/pci/ixgbe/ixgbe_dcb_82599.h		1.7
+sys/dev/pci/ixgbe/ixgbe_fdir.h			1.3
+sys/dev/pci/ixgbe/ixgbe_features.h		1.3
+sys/dev/pci/ixgbe/ixgbe_mbx.c			1.12
+sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.16-1.17
+sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.13-1.14
+sys/dev/pci/ixgbe/ixgbe_netmap.c		1.3-1.4
+sys/dev/pci/ixgbe/ixgbe_netmap.h		1.2
+sys/dev/pci/ixgbe/ixgbe_osdep.c			1.7
+sys/dev/pci/ixgbe/ixgbe_osdep.h			1.29-1.30
+sys/dev/pci/ixgbe/ixgbe_phy.c			1.24
+sys/dev/pci/ixgbe/ixgbe_rss.h			1.5
+sys/dev/pci/ixgbe/ixgbe_sriov.h			1.4
+sys/dev/pci/ixgbe/ixgbe_type.h			1.49
+sys/dev/pci/ixgbe/ixgbe_vf.c			1.27
+sys/dev/pci/ixgbe/ixgbe_x540.c			1.18-1.19
+sys/dev/pci/ixgbe/ixgbe_x540.h			1.9
+sys/dev/pci/ixgbe/ixgbe_x550.c			1.19-1.20
+sys/dev/pci/ixgbe/ixgbe_x550.h			1.6
+sys/dev/pci/files.pci1.438
+share/man/man4/ixg.41.15
+share/man/man4/ixv.41.8
+
+	- Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.
+	  Before this commit, resource shortage was easily occurred because
+	  the total number of the clusters is small.
+	- Improve performance:
+	  - Use m_adj(ETHER_ALIGN) more.
+	  - Sprinkle __predict_false() in the RX path.
+	  - Don't pre-allocate a cluster for RXCOPY case to improve short
+	packet's performance.
+	- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
+	  DMA buffer. Also, when the buffer is already freed, do not call
+	  bus_dmamap_unload(9) (no resource leaks with this change). This
+	  change is required to make ixg(4) work on alpha.
+	- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
+	- Fix panic when bus_dmamap_load_mbuf() failed in
+	  ixgbe_setup_receive_ring().
+	- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
+	  on aarch64.
+	- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
+	  address. At least, this change is required for macppc
+	  (sizeof(bus_addr_t) == 4) to make TX work.
+	- Fix little-endian dependence.
+	- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
+	- Refresh unrefreshed descriptors' buffers correctly.
+	- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
+	  panic.
+	- Save the discard_multidesc state to not to forget the state by
+	  exiting rxeof().
+	- Add missing increment of no_mbuf error counter.
+	- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
+	  packet.
+	- ixv: Modify error message to sync with ixgbe.c
+	- Print the error value of ixgbe_reset_hw() for debugging.
+	- Remove extra unlock/lock processing around if_percpuq_enqueue().
+	- Refactor rxr->next_to_check updating.
+	- Add new sysctl "rx_copy_len".
+	- Add a new sysctl to read rxr->next_to_refresh.
+	- Print error number when error occurred.
+	- Rename ix{gbe,v}_stop() with ix{gbe,v}_stop_locked(). No functional
+	  change.
+	- Don't use fixed value.
+	- Comment out flow director processing in fast path.
+	- Add missing NetBSD RCS IDs and __KERNEL_RCSID()s.
+	- KNF.
+	- Fix typos.
+	[msaitoh, ticket #1696]



CVS commit: [netbsd-8] src/doc

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:39:19 UTC 2021

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

Log Message:
Ticket #1696


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.101 -r1.1.2.102 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:38:01 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-8]: ixg.4 ixv.4
src/sys/dev/pci [netbsd-8]: files.pci
src/sys/dev/pci/ixgbe [netbsd-8]: if_bypass.c if_fdir.c if_sriov.c
ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82599.c ixgbe_api.c
ixgbe_bypass.h ixgbe_common.c ixgbe_dcb.c ixgbe_dcb.h
ixgbe_dcb_82598.c ixgbe_dcb_82598.h ixgbe_dcb_82599.c
ixgbe_dcb_82599.h ixgbe_fdir.h ixgbe_features.h ixgbe_mbx.c
ixgbe_netbsd.c ixgbe_netbsd.h ixgbe_netmap.c ixgbe_netmap.h
ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixgbe_rss.h ixgbe_sriov.h
ixgbe_type.h ixgbe_vf.c ixgbe_x540.c ixgbe_x540.h ixgbe_x550.c
ixgbe_x550.h ixv.c

Log Message:
Pull up the following (all via patch), requested by msaitoh in ticket #1696:

sysdev/pci/ixgbe/ixgbe.c1.252, 1.280-1.283, 
1.286-1.287, 1.289-1.290 via patch
sysdev/pci/ixgbe/ixgbe.h1.73, 1.76-1.80 via 
patch
sysdev/pci/ixgbe/ix_txrx.c  1.68-1.93
sysdev/pci/ixgbe/ixv.c  1.153, 1.157-1.161, 
1.163-1.166 via patch
sysdev/pci/ixgbe/if_bypass.c1.7-1.9
sysdev/pci/ixgbe/if_fdir.c  1.4-1.5
sysdev/pci/ixgbe/if_sriov.c 1.10-1.11
sysdev/pci/ixgbe/ixgbe_82598.c  1.16
sysdev/pci/ixgbe/ixgbe_82599.c  1.23
sysdev/pci/ixgbe/ixgbe_api.c1.25
sysdev/pci/ixgbe/ixgbe_bypass.h 1.2
sysdev/pci/ixgbe/ixgbe_common.c 1.30-1.33
sysdev/pci/ixgbe/ixgbe_dcb.c1.10-1.11
sysdev/pci/ixgbe/ixgbe_dcb.h1.7
sysdev/pci/ixgbe/ixgbe_dcb_82598.c  1.8-1.9
sysdev/pci/ixgbe/ixgbe_dcb_82598.h  1.7
sysdev/pci/ixgbe/ixgbe_dcb_82599.c  1.8-1.9
sysdev/pci/ixgbe/ixgbe_dcb_82599.h  1.7
sysdev/pci/ixgbe/ixgbe_fdir.h   1.3
sysdev/pci/ixgbe/ixgbe_features.h   1.3
sysdev/pci/ixgbe/ixgbe_mbx.c1.12
sysdev/pci/ixgbe/ixgbe_netbsd.c 1.16-1.17
sysdev/pci/ixgbe/ixgbe_netbsd.h 1.13-1.14
sysdev/pci/ixgbe/ixgbe_netmap.c 1.3-1.4
sysdev/pci/ixgbe/ixgbe_netmap.h 1.2
sysdev/pci/ixgbe/ixgbe_osdep.c  1.7
sysdev/pci/ixgbe/ixgbe_osdep.h  1.29-1.30
sysdev/pci/ixgbe/ixgbe_phy.c1.24
sysdev/pci/ixgbe/ixgbe_rss.h1.5
sysdev/pci/ixgbe/ixgbe_sriov.h  1.4
sysdev/pci/ixgbe/ixgbe_type.h   1.49
sysdev/pci/ixgbe/ixgbe_vf.c 1.27
sysdev/pci/ixgbe/ixgbe_x540.c   1.18-1.19
sysdev/pci/ixgbe/ixgbe_x540.h   1.9
sysdev/pci/ixgbe/ixgbe_x550.c   1.19-1.20
sysdev/pci/ixgbe/ixgbe_x550.h   1.6
sysdev/pci/files.pci1.438
share/man/man4/ixg.41.15
share/man/man4/ixv.41.8

- Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.
  Before this commit, resource shortage was easily occurred because
  the total number of the clusters is small.
- Improve performance:
  - Use m_adj(ETHER_ALIGN) more.
  - Sprinkle __predict_false() in the RX path.
  - Don't pre-allocate a cluster for RXCOPY case to improve short
packet's performance.
- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
  DMA buffer. Also, when the buffer is already freed, do not call
  bus_dmamap_unload(9) (no resource leaks with this change). This
  change is required to make ixg(4) work on alpha.
- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
- Fix panic when bus_dmamap_load_mbuf() failed in
  ixgbe_setup_receive_ring().
- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
  on aarch64.
- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
  address. At least, this change is required for macppc
  (sizeof(bus_addr_t) == 4) to make TX work.
- Fix little-endian dependence.
- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
- Refresh unrefreshed descriptors' buffers correctly.
- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
  panic.
- Save the discard_multidesc state to not to forget the state by
  exiting rxeof().
- Add missing increment of no_mbuf error counter.
- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
  packet.
- ixv: Modify error message to sync with ixgbe.c
- Print the error value of 

CVS commit: [netbsd-8] src

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:38:01 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-8]: ixg.4 ixv.4
src/sys/dev/pci [netbsd-8]: files.pci
src/sys/dev/pci/ixgbe [netbsd-8]: if_bypass.c if_fdir.c if_sriov.c
ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82599.c ixgbe_api.c
ixgbe_bypass.h ixgbe_common.c ixgbe_dcb.c ixgbe_dcb.h
ixgbe_dcb_82598.c ixgbe_dcb_82598.h ixgbe_dcb_82599.c
ixgbe_dcb_82599.h ixgbe_fdir.h ixgbe_features.h ixgbe_mbx.c
ixgbe_netbsd.c ixgbe_netbsd.h ixgbe_netmap.c ixgbe_netmap.h
ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixgbe_rss.h ixgbe_sriov.h
ixgbe_type.h ixgbe_vf.c ixgbe_x540.c ixgbe_x540.h ixgbe_x550.c
ixgbe_x550.h ixv.c

Log Message:
Pull up the following (all via patch), requested by msaitoh in ticket #1696:

sysdev/pci/ixgbe/ixgbe.c1.252, 1.280-1.283, 
1.286-1.287, 1.289-1.290 via patch
sysdev/pci/ixgbe/ixgbe.h1.73, 1.76-1.80 via 
patch
sysdev/pci/ixgbe/ix_txrx.c  1.68-1.93
sysdev/pci/ixgbe/ixv.c  1.153, 1.157-1.161, 
1.163-1.166 via patch
sysdev/pci/ixgbe/if_bypass.c1.7-1.9
sysdev/pci/ixgbe/if_fdir.c  1.4-1.5
sysdev/pci/ixgbe/if_sriov.c 1.10-1.11
sysdev/pci/ixgbe/ixgbe_82598.c  1.16
sysdev/pci/ixgbe/ixgbe_82599.c  1.23
sysdev/pci/ixgbe/ixgbe_api.c1.25
sysdev/pci/ixgbe/ixgbe_bypass.h 1.2
sysdev/pci/ixgbe/ixgbe_common.c 1.30-1.33
sysdev/pci/ixgbe/ixgbe_dcb.c1.10-1.11
sysdev/pci/ixgbe/ixgbe_dcb.h1.7
sysdev/pci/ixgbe/ixgbe_dcb_82598.c  1.8-1.9
sysdev/pci/ixgbe/ixgbe_dcb_82598.h  1.7
sysdev/pci/ixgbe/ixgbe_dcb_82599.c  1.8-1.9
sysdev/pci/ixgbe/ixgbe_dcb_82599.h  1.7
sysdev/pci/ixgbe/ixgbe_fdir.h   1.3
sysdev/pci/ixgbe/ixgbe_features.h   1.3
sysdev/pci/ixgbe/ixgbe_mbx.c1.12
sysdev/pci/ixgbe/ixgbe_netbsd.c 1.16-1.17
sysdev/pci/ixgbe/ixgbe_netbsd.h 1.13-1.14
sysdev/pci/ixgbe/ixgbe_netmap.c 1.3-1.4
sysdev/pci/ixgbe/ixgbe_netmap.h 1.2
sysdev/pci/ixgbe/ixgbe_osdep.c  1.7
sysdev/pci/ixgbe/ixgbe_osdep.h  1.29-1.30
sysdev/pci/ixgbe/ixgbe_phy.c1.24
sysdev/pci/ixgbe/ixgbe_rss.h1.5
sysdev/pci/ixgbe/ixgbe_sriov.h  1.4
sysdev/pci/ixgbe/ixgbe_type.h   1.49
sysdev/pci/ixgbe/ixgbe_vf.c 1.27
sysdev/pci/ixgbe/ixgbe_x540.c   1.18-1.19
sysdev/pci/ixgbe/ixgbe_x540.h   1.9
sysdev/pci/ixgbe/ixgbe_x550.c   1.19-1.20
sysdev/pci/ixgbe/ixgbe_x550.h   1.6
sysdev/pci/files.pci1.438
share/man/man4/ixg.41.15
share/man/man4/ixv.41.8

- Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.
  Before this commit, resource shortage was easily occurred because
  the total number of the clusters is small.
- Improve performance:
  - Use m_adj(ETHER_ALIGN) more.
  - Sprinkle __predict_false() in the RX path.
  - Don't pre-allocate a cluster for RXCOPY case to improve short
packet's performance.
- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
  DMA buffer. Also, when the buffer is already freed, do not call
  bus_dmamap_unload(9) (no resource leaks with this change). This
  change is required to make ixg(4) work on alpha.
- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
- Fix panic when bus_dmamap_load_mbuf() failed in
  ixgbe_setup_receive_ring().
- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
  on aarch64.
- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
  address. At least, this change is required for macppc
  (sizeof(bus_addr_t) == 4) to make TX work.
- Fix little-endian dependence.
- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
- Refresh unrefreshed descriptors' buffers correctly.
- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
  panic.
- Save the discard_multidesc state to not to forget the state by
  exiting rxeof().
- Add missing increment of no_mbuf error counter.
- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
  packet.
- ixv: Modify error message to sync with ixgbe.c
- Print the error value of 

CVS commit: [netbsd-8] src/doc

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:34:29 UTC 2021

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

Log Message:
Fix editor mishap/typo


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 src/doc/CHANGES-8.2
cvs rdiff -u -r1.1.2.100 -r1.1.2.101 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/doc

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:34:29 UTC 2021

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

Log Message:
Fix editor mishap/typo


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 src/doc/CHANGES-8.2
cvs rdiff -u -r1.1.2.100 -r1.1.2.101 src/doc/CHANGES-8.3

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.115 src/doc/CHANGES-8.2:1.1.2.116
--- src/doc/CHANGES-8.2:1.1.2.115	Tue Mar 31 05:08:40 2020
+++ src/doc/CHANGES-8.2	Wed Sep 15 16:34:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.115 2020/03/31 05:08:40 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.116 2021/09/15 16:34:29 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1920,7 +1920,7 @@ sys/dev/pci/ixgbe/if_bypass.c		1.5
 sys/dev/pci/ixgbe/ixgbe_osdep.c		1.5
 sys/dev/pci/ixgbe/ix_txrx.c		1.58-1.60
 sys/dev/pci/ixgbe/ixgbe.c		1.195,1.220-1.221 via patch
-sys/dev/pci/ixgbe/ixgbe.h		1.60-1.2
+sys/dev/pci/ixgbe/ixgbe.h		1.60-1.62
 sys/dev/pci/ixgbe/ixgbe_api.c		1.24
 sys/dev/pci/ixgbe/ixgbe_common.c	1.26
 sys/dev/pci/ixgbe/ixgbe_netbsd.c	1.11-1.12

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.100 src/doc/CHANGES-8.3:1.1.2.101
--- src/doc/CHANGES-8.3:1.1.2.100	Wed Sep 15 05:12:03 2021
+++ src/doc/CHANGES-8.3	Wed Sep 15 16:34:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.100 2021/09/15 05:12:03 msaitoh Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.101 2021/09/15 16:34:29 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -1775,7 +1775,7 @@ sys/dev/pci/ixgbe/ixgbe.c			1.259, 1.278
 sys/dev/pci/ixgbe/ixgbe.h			1.75
 sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.12
 sys/dev/pci/ixgbe/ixgbe_vf.c			1.24-1.26
-sys/dev/pci/ixgbe/ixgbe_x550.c			1.17
+sys/dev/pci/ixgbe/ixgbe_x540.c			1.17
 sys/dev/pci/ixgbe/ixv.c1.155-1.156
 sys/dev/pci/ixgbe/ix_txrx.c			1.64-67
 sys/dev/pci/files.pci1.436



CVS commit: [netbsd-9] src/doc

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:32:30 UTC 2021

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

Log Message:
Ticket #1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.29 -r1.1.2.30 src/doc/CHANGES-9.3

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.3
diff -u src/doc/CHANGES-9.3:1.1.2.29 src/doc/CHANGES-9.3:1.1.2.30
--- src/doc/CHANGES-9.3:1.1.2.29	Tue Sep 14 02:23:35 2021
+++ src/doc/CHANGES-9.3	Wed Sep 15 16:32:30 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.29 2021/09/14 02:23:35 msaitoh Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.30 2021/09/15 16:32:30 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -646,3 +646,87 @@ build.sh	1.348-1.352, 1.356
 	Support for MKREPRO and automatic timestamps when the source
 	tree is from git or mercurial.
 	[martin, ticket #1345]
+
+sys/dev/pci/ixgbe/ixgbe.c			1.252, 1.280-1.283, 1.286-1.287, 1.289-1.290 via patch
+sys/dev/pci/ixgbe/ixgbe.h			1.76-1.80 via patch
+sys/dev/pci/ixgbe/ix_txrx.c			1.68-1.79, 1.80-1.93
+sys/dev/pci/ixgbe/ixv.c1.153, 1.157-1.161, 1.163-1.166 via patch
+sys/dev/pci/ixgbe/if_bypass.c			1.7-1.9
+sys/dev/pci/ixgbe/if_fdir.c			1.4-1.5
+sys/dev/pci/ixgbe/if_sriov.c			1.10-1.11
+sys/dev/pci/ixgbe/ixgbe_bypass.h		1.2
+sys/dev/pci/ixgbe/ixgbe_82598.c			1.16
+sys/dev/pci/ixgbe/ixgbe_82599.c			1.23
+sys/dev/pci/ixgbe/ixgbe_api.c			1.25
+sys/dev/pci/ixgbe/ixgbe_common.c		1.30-1.33
+sys/dev/pci/ixgbe/ixgbe_dcb.c			1.10-1.11
+sys/dev/pci/ixgbe/ixgbe_dcb.h			1.7
+sys/dev/pci/ixgbe/ixgbe_dcb_82598.c		1.8-1.9
+sys/dev/pci/ixgbe/ixgbe_dcb_82598.h		1.7
+sys/dev/pci/ixgbe/ixgbe_dcb_82599.c		1.8-1.9
+sys/dev/pci/ixgbe/ixgbe_dcb_82599.h		1.7
+sys/dev/pci/ixgbe/ixgbe_fdir.h			1.3
+sys/dev/pci/ixgbe/ixgbe_features.h		1.3
+sys/dev/pci/ixgbe/ixgbe_mbx.c			1.12
+sys/dev/pci/ixgbe/ixgbe_netbsd.c		1.13, 1.16-1.17
+sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.13-1.14
+sys/dev/pci/ixgbe/ixgbe_netmap.c		1.3-1.4
+sys/dev/pci/ixgbe/ixgbe_netmap.h		1.2
+sys/dev/pci/ixgbe/ixgbe_osdep.c			1.7
+sys/dev/pci/ixgbe/ixgbe_osdep.h			1.29-1.30
+sys/dev/pci/ixgbe/ixgbe_phy.c			1.24
+sys/dev/pci/ixgbe/ixgbe_rss.h			1.5
+sys/dev/pci/ixgbe/ixgbe_sriov.h			1.4
+sys/dev/pci/ixgbe/ixgbe_type.h			1.49
+sys/dev/pci/ixgbe/ixgbe_vf.c			1.27
+sys/dev/pci/ixgbe/ixgbe_x540.c			1.18-1.19
+sys/dev/pci/ixgbe/ixgbe_x540.h			1.9
+sys/dev/pci/ixgbe/ixgbe_x550.c			1.19-1.20
+sys/dev/pci/ixgbe/ixgbe_x550.h			1.6
+sys/dev/pci/files.pci1.438
+share/man/man4/ixg.41.15
+share/man/man4/ixv.41.8
+
+	- Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.
+	  Before this commit, resource shortage was easily occurred because
+	  the total number of the clusters is small.
+	- Improve performace:
+	  - Use m_adj(ETHER_ALIGN) more.
+	  - Sprinkle __predict_false() in the RX path.
+	  - Don't pre-allocate a cluster for RXCOPY case to improve short
+	packet's performance.
+	- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
+	  DMA buffer. Also, when the buffer is already freed, do not call
+  bus_dmamap_unload(9) (no resource leaks with this change). This
+	  change is required to make ixg(4) work on alpha.
+	- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
+	- Fix panic when bus_dmamap_load_mbuf() failed in
+	  ixgbe_setup_receive_ring().
+	- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
+	  on aarch64.
+	- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
+	  address. At least, this change is required for macppc
+	  (sizeof(bus_addr_t) == 4) to make TX work.
+	- Fix little-endian dependence.
+	- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
+	- Refresh unrefreshed descriptors' buffers correctly.
+	- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
+	  panic.
+	- Save the discard_multidesc state to not to forget the state by
+	  exiting rxeof().
+	- Add missing increment of no_mbuf error counter.
+	- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
+	  packet.
+	- ixv: Modify error message to sync with ixgbe.c
+	- Print the error value of ixgbe_reset_hw() for debugging.
+	- Remove extra unlock/lock processing around if_percpuq_enqueue().
+	- Refactor rxr->next_to_check updating.
+	- Add new sysctl "rx_copy_len".
+	- Add a new sysctl to read rxr->next_to_refresh.
+	- Print error number when error occurred.
+	- Comment out flow director processing in fast path.
+	- Add missing NetBSD RCS IDs and __KERNEL_RCSID()s.
+	- KNF.
+	- Fix typos.
+	[msaitoh, ticket #1346]
+



CVS commit: [netbsd-9] src/doc

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:32:30 UTC 2021

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

Log Message:
Ticket #1346


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.29 -r1.1.2.30 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:30:51 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-9]: ixg.4 ixv.4
src/sys/dev/pci [netbsd-9]: files.pci
src/sys/dev/pci/ixgbe [netbsd-9]: if_bypass.c if_fdir.c if_sriov.c
ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82599.c ixgbe_api.c
ixgbe_bypass.h ixgbe_common.c ixgbe_dcb.c ixgbe_dcb.h
ixgbe_dcb_82598.c ixgbe_dcb_82598.h ixgbe_dcb_82599.c
ixgbe_dcb_82599.h ixgbe_fdir.h ixgbe_features.h ixgbe_mbx.c
ixgbe_netbsd.c ixgbe_netbsd.h ixgbe_netmap.c ixgbe_netmap.h
ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixgbe_rss.h ixgbe_sriov.h
ixgbe_type.h ixgbe_vf.c ixgbe_x540.c ixgbe_x540.h ixgbe_x550.c
ixgbe_x550.h ixv.c

Log Message:
Pull up the following (via patch), requested by msaitoh in ticket #1346:

sys/dev/pci/ixgbe/ixgbe.c   1.252, 1.280-1.283, 
1.286-1.287, 1.289-1.290 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.73, 1.76-1.80 via 
patch
sys/dev/pci/ixgbe/ix_txrx.c 1.68-1.93
sys/dev/pci/ixgbe/ixv.c 1.153, 1.157-1.161, 
1.163-1.166 via patch
sys/dev/pci/ixgbe/if_bypass.c   1.7-1.9
sys/dev/pci/ixgbe/if_fdir.c 1.4-1.5
sys/dev/pci/ixgbe/if_sriov.c1.10-1.11
sys/dev/pci/ixgbe/ixgbe_82598.c 1.16
sys/dev/pci/ixgbe/ixgbe_82599.c 1.23
sys/dev/pci/ixgbe/ixgbe_api.c   1.25
sys/dev/pci/ixgbe/ixgbe_bypass.h1.2
sys/dev/pci/ixgbe/ixgbe_common.c1.30-1.33
sys/dev/pci/ixgbe/ixgbe_dcb.c   1.10-1.11
sys/dev/pci/ixgbe/ixgbe_dcb.h   1.7
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c 1.8-1.9
sys/dev/pci/ixgbe/ixgbe_dcb_82598.h 1.7
sys/dev/pci/ixgbe/ixgbe_dcb_82599.c 1.8-1.9
sys/dev/pci/ixgbe/ixgbe_dcb_82599.h 1.7
sys/dev/pci/ixgbe/ixgbe_fdir.h  1.3
sys/dev/pci/ixgbe/ixgbe_features.h  1.3
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.12
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.13, 1.16-1.17
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.13-1.14
sys/dev/pci/ixgbe/ixgbe_netmap.c1.3-1.4
sys/dev/pci/ixgbe/ixgbe_netmap.h1.2
sys/dev/pci/ixgbe/ixgbe_osdep.c 1.7
sys/dev/pci/ixgbe/ixgbe_osdep.h 1.29-1.30
sys/dev/pci/ixgbe/ixgbe_phy.c   1.24
sys/dev/pci/ixgbe/ixgbe_rss.h   1.5
sys/dev/pci/ixgbe/ixgbe_sriov.h 1.4
sys/dev/pci/ixgbe/ixgbe_type.h  1.49
sys/dev/pci/ixgbe/ixgbe_vf.c1.27
sys/dev/pci/ixgbe/ixgbe_x540.c  1.18-1.19
sys/dev/pci/ixgbe/ixgbe_x540.h  1.9
sys/dev/pci/ixgbe/ixgbe_x550.c  1.19-1.20
sys/dev/pci/ixgbe/ixgbe_x550.h  1.6
sys/dev/pci/files.pci   1.438
share/man/man4/ixg.41.15
share/man/man4/ixv.41.8

- Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.
  Before this commit, resource shortage was easily occurred because
  the total number of the clusters is small.
- Improve performance:
  - Use m_adj(ETHER_ALIGN) more.
  - Sprinkle __predict_false() in the RX path.
  - Don't pre-allocate a cluster for RXCOPY case to improve short
packet's performance.
- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
  DMA buffer. Also, when the buffer is already freed, do not call
  bus_dmamap_unload(9) (no resource leaks with this change). This
  change is required to make ixg(4) work on alpha.
- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
- Fix panic when bus_dmamap_load_mbuf() failed in
  ixgbe_setup_receive_ring().
- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
  on aarch64.
- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
  address. At least, this change is required for macppc
  (sizeof(bus_addr_t) == 4) to make TX work.
- Fix little-endian dependence.
- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
- Refresh unrefreshed descriptors' buffers correctly.
- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
  panic.
- Save the discard_multidesc state to not to forget the state by
  exiting rxeof().
- Add missing increment of no_mbuf error counter.
- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
  packet.
- ixv: Modify error message to sync with ixgbe.c
- Print the error value 

CVS commit: [netbsd-9] src

2021-09-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Sep 15 16:30:51 UTC 2021

Modified Files:
src/share/man/man4 [netbsd-9]: ixg.4 ixv.4
src/sys/dev/pci [netbsd-9]: files.pci
src/sys/dev/pci/ixgbe [netbsd-9]: if_bypass.c if_fdir.c if_sriov.c
ix_txrx.c ixgbe.c ixgbe.h ixgbe_82598.c ixgbe_82599.c ixgbe_api.c
ixgbe_bypass.h ixgbe_common.c ixgbe_dcb.c ixgbe_dcb.h
ixgbe_dcb_82598.c ixgbe_dcb_82598.h ixgbe_dcb_82599.c
ixgbe_dcb_82599.h ixgbe_fdir.h ixgbe_features.h ixgbe_mbx.c
ixgbe_netbsd.c ixgbe_netbsd.h ixgbe_netmap.c ixgbe_netmap.h
ixgbe_osdep.c ixgbe_osdep.h ixgbe_phy.c ixgbe_rss.h ixgbe_sriov.h
ixgbe_type.h ixgbe_vf.c ixgbe_x540.c ixgbe_x540.h ixgbe_x550.c
ixgbe_x550.h ixv.c

Log Message:
Pull up the following (via patch), requested by msaitoh in ticket #1346:

sys/dev/pci/ixgbe/ixgbe.c   1.252, 1.280-1.283, 
1.286-1.287, 1.289-1.290 via patch
sys/dev/pci/ixgbe/ixgbe.h   1.73, 1.76-1.80 via 
patch
sys/dev/pci/ixgbe/ix_txrx.c 1.68-1.93
sys/dev/pci/ixgbe/ixv.c 1.153, 1.157-1.161, 
1.163-1.166 via patch
sys/dev/pci/ixgbe/if_bypass.c   1.7-1.9
sys/dev/pci/ixgbe/if_fdir.c 1.4-1.5
sys/dev/pci/ixgbe/if_sriov.c1.10-1.11
sys/dev/pci/ixgbe/ixgbe_82598.c 1.16
sys/dev/pci/ixgbe/ixgbe_82599.c 1.23
sys/dev/pci/ixgbe/ixgbe_api.c   1.25
sys/dev/pci/ixgbe/ixgbe_bypass.h1.2
sys/dev/pci/ixgbe/ixgbe_common.c1.30-1.33
sys/dev/pci/ixgbe/ixgbe_dcb.c   1.10-1.11
sys/dev/pci/ixgbe/ixgbe_dcb.h   1.7
sys/dev/pci/ixgbe/ixgbe_dcb_82598.c 1.8-1.9
sys/dev/pci/ixgbe/ixgbe_dcb_82598.h 1.7
sys/dev/pci/ixgbe/ixgbe_dcb_82599.c 1.8-1.9
sys/dev/pci/ixgbe/ixgbe_dcb_82599.h 1.7
sys/dev/pci/ixgbe/ixgbe_fdir.h  1.3
sys/dev/pci/ixgbe/ixgbe_features.h  1.3
sys/dev/pci/ixgbe/ixgbe_mbx.c   1.12
sys/dev/pci/ixgbe/ixgbe_netbsd.c1.13, 1.16-1.17
sys/dev/pci/ixgbe/ixgbe_netbsd.h1.13-1.14
sys/dev/pci/ixgbe/ixgbe_netmap.c1.3-1.4
sys/dev/pci/ixgbe/ixgbe_netmap.h1.2
sys/dev/pci/ixgbe/ixgbe_osdep.c 1.7
sys/dev/pci/ixgbe/ixgbe_osdep.h 1.29-1.30
sys/dev/pci/ixgbe/ixgbe_phy.c   1.24
sys/dev/pci/ixgbe/ixgbe_rss.h   1.5
sys/dev/pci/ixgbe/ixgbe_sriov.h 1.4
sys/dev/pci/ixgbe/ixgbe_type.h  1.49
sys/dev/pci/ixgbe/ixgbe_vf.c1.27
sys/dev/pci/ixgbe/ixgbe_x540.c  1.18-1.19
sys/dev/pci/ixgbe/ixgbe_x540.h  1.9
sys/dev/pci/ixgbe/ixgbe_x550.c  1.19-1.20
sys/dev/pci/ixgbe/ixgbe_x550.h  1.6
sys/dev/pci/files.pci   1.438
share/man/man4/ixg.41.15
share/man/man4/ixv.41.8

- Use MCLGET() instead of homegrown cluster (jcl) allocation mechanism.
  Before this commit, resource shortage was easily occurred because
  the total number of the clusters is small.
- Improve performance:
  - Use m_adj(ETHER_ALIGN) more.
  - Sprinkle __predict_false() in the RX path.
  - Don't pre-allocate a cluster for RXCOPY case to improve short
packet's performance.
- Call bus_dmamap_unload(9) via ixgbe_dmamap_unload(), before freeing
  DMA buffer. Also, when the buffer is already freed, do not call
  bus_dmamap_unload(9) (no resource leaks with this change). This
  change is required to make ixg(4) work on alpha.
- Keep m_len and m_pkthdr.len consistent to prevent panic on arm.
- Fix panic when bus_dmamap_load_mbuf() failed in
  ixgbe_setup_receive_ring().
- Added BUS_DMA_COHERENT flag to bus_dmamem_map() to improve stability
  on aarch64.
- Use uint64_t instead of bus_addr_t for the TX descriptor's buffer
  address. At least, this change is required for macppc
  (sizeof(bus_addr_t) == 4) to make TX work.
- Fix little-endian dependence.
- Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
- Refresh unrefreshed descriptors' buffers correctly.
- Don't call bus_dmamap_sync with rx_mbuf_sz(== MCLBYTES) to prevent
  panic.
- Save the discard_multidesc state to not to forget the state by
  exiting rxeof().
- Add missing increment of no_mbuf error counter.
- Don't increment no_mbuf evcnt(9) when discarding multi-descriptor
  packet.
- ixv: Modify error message to sync with ixgbe.c
- Print the error value 

CVS commit: [netbsd-9] src/doc

2021-09-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 10 07:50:49 UTC 2021

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

Log Message:
Fix typo, pointed out by msaitoh


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-9.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-9.2
diff -u src/doc/CHANGES-9.2:1.1.2.83 src/doc/CHANGES-9.2:1.1.2.84
--- src/doc/CHANGES-9.2:1.1.2.83	Wed May 12 13:15:55 2021
+++ src/doc/CHANGES-9.2	Fri Sep 10 07:50:49 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.2,v 1.1.2.83 2021/05/12 13:15:55 martin Exp $
+# $NetBSD: CHANGES-9.2,v 1.1.2.84 2021/09/10 07:50:49 martin Exp $
 
 A complete list of changes from the NetBSD 9.1 release to the NetBSD 9.2
 release:
@@ -1838,7 +1838,7 @@ sys/dev/pci/ixgbe/ixgbe.c			1.259, 1.278
 sys/dev/pci/ixgbe/ixgbe.h			1.75
 sys/dev/pci/ixgbe/ixgbe_netbsd.h		1.12
 sys/dev/pci/ixgbe/ixgbe_vf.c			1.24-1.26
-sys/dev/pci/ixgbe/ixgbe_x550.c			1.17
+sys/dev/pci/ixgbe/ixgbe_x540.c			1.17
 sys/dev/pci/ixgbe/ixv.c1.155-1.156
 sys/dev/pci/ixgbe/ix_txrx.c			1.64-67
 sys/dev/pci/files.pci1.436



CVS commit: [netbsd-9] src/doc

2021-09-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 10 07:50:49 UTC 2021

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

Log Message:
Fix typo, pointed out by msaitoh


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-9.2

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

2021-09-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 10 07:45:27 UTC 2021

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

Log Message:
Fix editor mishap, pointed out by msaitoh


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.180 -r1.1.2.181 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.180 src/doc/CHANGES-9.0:1.1.2.181
--- src/doc/CHANGES-9.0:1.1.2.180	Fri Feb 14 00:06:28 2020
+++ src/doc/CHANGES-9.0	Fri Sep 10 07:45:27 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.180 2020/02/14 00:06:28 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.181 2021/09/10 07:45:27 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -7901,7 +7901,7 @@ sys/dev/pci/ixgbe/if_bypass.c		1.5
 sys/dev/pci/ixgbe/ixgbe_osdep.c		1.5
 sys/dev/pci/ixgbe/ix_txrx.c		1.58-1.60
 sys/dev/pci/ixgbe/ixgbe.c		1.220-1.221
-sys/dev/pci/ixgbe/ixgbe.h		1.60-1.2
+sys/dev/pci/ixgbe/ixgbe.h		1.60-1.62
 sys/dev/pci/ixgbe/ixgbe_api.c		1.24
 sys/dev/pci/ixgbe/ixgbe_common.c	1.26
 sys/dev/pci/ixgbe/ixgbe_netbsd.c	1.11-1.12



CVS commit: [netbsd-9] src/doc

2021-09-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 10 07:45:27 UTC 2021

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

Log Message:
Fix editor mishap, pointed out by msaitoh


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

2021-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  9 15:00:01 UTC 2021

Modified Files:
src: build.sh

Log Message:
Add a new operation "mkrepro-timestamp" to extract the timestamp a
build with -P would use. Example usage:

./build.sh -T /usr/tools -P mkrepro-timestamp

This allows us to extract this information once, make other use of it,
and replicate it on other machines with -V MKREPRO=yes -V MKREPRO_TIMESTAMP=..


To generate a diff of this commit:
cvs rdiff -u -r1.355 -r1.356 src/build.sh

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

Modified files:

Index: src/build.sh
diff -u src/build.sh:1.355 src/build.sh:1.356
--- src/build.sh:1.355	Sun Aug 29 09:02:01 2021
+++ src/build.sh	Thu Sep  9 15:00:01 2021
@@ -1,5 +1,5 @@
 #! /usr/bin/env sh
-#	$NetBSD: build.sh,v 1.355 2021/08/29 09:02:01 christos Exp $
+#	$NetBSD: build.sh,v 1.356 2021/09/09 15:00:01 martin Exp $
 #
 # Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1071,6 +1071,8 @@ Usage: ${progname} [-EhnoPRrUuxy] [-a ar
 list-arch   Display a list of valid MACHINE/MACHINE_ARCH values,
 and exit.  The list may be narrowed by passing glob
 patterns or exact values in MACHINE or MACHINE_ARCH.
+mkrepro-timestamp   Show the latest source timestamp used for reproducable
+builds and exit.  Requires -P or -V MKREPRO=yes.
 
  Options:
 -a archSet MACHINE_ARCH to arch.  [Default: deduced from MACHINE]
@@ -1366,7 +1368,12 @@ parseoptions()
 
 		list-arch)
 			listarch "${MACHINE}" "${MACHINE_ARCH}"
-			exit $?
+			exit
+			;;
+		mkrepro-timestamp)
+			setup_mkrepro quiet
+			echo ${MKREPRO_TIMESTAMP:-0}
+			[ ${MKREPRO_TIMESTAMP:-0} -ne 0 ]; exit
 			;;
 
 		kernel=*|releasekernel=*|kernel.gdb=*)
@@ -1965,7 +1972,7 @@ createmakewrapper()
 	eval cat <

CVS commit: src

2021-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Sep  9 15:00:01 UTC 2021

Modified Files:
src: build.sh

Log Message:
Add a new operation "mkrepro-timestamp" to extract the timestamp a
build with -P would use. Example usage:

./build.sh -T /usr/tools -P mkrepro-timestamp

This allows us to extract this information once, make other use of it,
and replicate it on other machines with -V MKREPRO=yes -V MKREPRO_TIMESTAMP=..


To generate a diff of this commit:
cvs rdiff -u -r1.355 -r1.356 src/build.sh

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



CVS commit: src/distrib/sets

2021-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  7 18:02:46 UTC 2021

Modified Files:
src/distrib/sets: makesrctars

Log Message:
PR 56389: do not include top level .git or .hg directories
in source sets.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/distrib/sets/makesrctars

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/makesrctars
diff -u src/distrib/sets/makesrctars:1.42 src/distrib/sets/makesrctars:1.43
--- src/distrib/sets/makesrctars:1.42	Fri Sep 28 15:04:20 2018
+++ src/distrib/sets/makesrctars	Tue Sep  7 18:02:46 2021
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: makesrctars,v 1.42 2018/09/28 15:04:20 martin Exp $
+#	$NetBSD: makesrctars,v 1.43 2021/09/07 18:02:46 martin Exp $
 #
 # makesrctars srcdir setdir
 #	Create source tarballs in setdir from the source under srcdir.
@@ -84,8 +84,10 @@ makeset()
 		cd "${dir}"
 		srcprefix="${srcprefix}/${dir}"
 	fi
-	# Gets rid of any obj dirs and things below it 
-	echo "obj" > "${intmp}"
+	# Gets rid of any obj dirs and things below it. Also skip
+	# .hg or .git repositories (if we got the source via git
+	# or mercurial)
+	printf "obj\n./.git\n./.hg\n" > "${intmp}"
 	egrep="$*"
 	if [ "${egrep}" = "" ]; then
 		egrep='.'



CVS commit: src/distrib/sets

2021-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  7 18:02:46 UTC 2021

Modified Files:
src/distrib/sets: makesrctars

Log Message:
PR 56389: do not include top level .git or .hg directories
in source sets.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/distrib/sets/makesrctars

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

2021-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  7 17:13:20 UTC 2021

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

Log Message:
Ticket #1343


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/doc/CHANGES-9.3

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.3
diff -u src/doc/CHANGES-9.3:1.1.2.26 src/doc/CHANGES-9.3:1.1.2.27
--- src/doc/CHANGES-9.3:1.1.2.26	Sun Sep  5 10:49:51 2021
+++ src/doc/CHANGES-9.3	Tue Sep  7 17:13:20 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.26 2021/09/05 10:49:51 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.27 2021/09/07 17:13:20 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -627,4 +627,11 @@ sys/arch/mips/mips/trap.c			1.250,1.251
 	mips: fix and disable a debug message for TLB handling.
 	[tsutsui, ticket #1342]
 
+lib/libc/sys/fcntl.21.46 (patch)
+lib/libc/sys/flock.21.23
+share/man/man7/sysctl.71.153
+sys/kern/vfs_lockf.c1.74
+
+	Tie the maximum file lock per unprivilegied uid to kern.maxfiles.
+	[manu, ticket #1343]
 



CVS commit: [netbsd-9] src/doc

2021-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  7 17:13:20 UTC 2021

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

Log Message:
Ticket #1343


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/doc/CHANGES-9.3

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



CVS commit: [netbsd-9] src

2021-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  7 17:12:21 UTC 2021

Modified Files:
src/lib/libc/sys [netbsd-9]: fcntl.2 flock.2
src/share/man/man7 [netbsd-9]: sysctl.7
src/sys/kern [netbsd-9]: vfs_lockf.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1343):

share/man/man7/sysctl.7: revision 1.153
sys/kern/vfs_lockf.c: revision 1.74
lib/libc/sys/fcntl.2: revision 1.46
lib/libc/sys/flock.2: revision 1.23

Tie the maximum file lock per unprivilegied uid to kern.maxfiles

This makes the limit simple to raise at run time. While there, document
that fcntl(2) and flock(2) may return ENOMEM when this limit is reached.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.28.1 src/lib/libc/sys/fcntl.2
cvs rdiff -u -r1.22 -r1.22.44.1 src/lib/libc/sys/flock.2
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.73 -r1.73.60.1 src/sys/kern/vfs_lockf.c

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

Modified files:

Index: src/lib/libc/sys/fcntl.2
diff -u src/lib/libc/sys/fcntl.2:1.41 src/lib/libc/sys/fcntl.2:1.41.28.1
--- src/lib/libc/sys/fcntl.2:1.41	Sat Dec 28 20:03:22 2013
+++ src/lib/libc/sys/fcntl.2	Tue Sep  7 17:12:21 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fcntl.2,v 1.41 2013/12/28 20:03:22 dholland Exp $
+.\"	$NetBSD: fcntl.2,v 1.41.28.1 2021/09/07 17:12:21 martin Exp $
 .\"
 .\" Copyright (c) 1983, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -501,6 +501,10 @@ or
 .Dv F_SETLKW ,
 and satisfying the lock or unlock request would result in the
 number of locked regions in the system exceeding a system-imposed limit.
+.It Bq Er ENOMEM
+The file lock limit for the current unprivilegied user 
+has been reached. It can be modified using sysctl
+.Li kern.maxfiles .
 .It Bq Er ESRCH
 .Fa cmd
 is

Index: src/lib/libc/sys/flock.2
diff -u src/lib/libc/sys/flock.2:1.22 src/lib/libc/sys/flock.2:1.22.44.1
--- src/lib/libc/sys/flock.2:1.22	Sat Oct 15 21:35:50 2011
+++ src/lib/libc/sys/flock.2	Tue Sep  7 17:12:21 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: flock.2,v 1.22 2011/10/15 21:35:50 rmind Exp $
+.\"	$NetBSD: flock.2,v 1.22.44.1 2021/09/07 17:12:21 martin Exp $
 .\"
 .\" Copyright (c) 1983, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -137,6 +137,10 @@ does not include exactly one of
 .Dv LOCK_SH ,
 or
 .Dv LOCK_UN .
+.It Bq Eq ENOMEM
+The file lock limit for the current unprivilegied user 
+has been reached. It can be modifed using sysctl
+.Li kern.maxfiles .
 .It Bq Er EOPNOTSUPP
 The argument
 .Fa fd

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.139.2.1 src/share/man/man7/sysctl.7:1.139.2.2
--- src/share/man/man7/sysctl.7:1.139.2.1	Mon Nov 18 19:45:00 2019
+++ src/share/man/man7/sysctl.7	Tue Sep  7 17:12:21 2021
@@ -1,4 +1,4 @@
-.\"	$NetBSD: sysctl.7,v 1.139.2.1 2019/11/18 19:45:00 martin Exp $
+.\"	$NetBSD: sysctl.7,v 1.139.2.2 2021/09/07 17:12:21 martin Exp $
 .\"
 .\" Copyright (c) 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -736,6 +736,11 @@ Memory Mapped Files Option is available 
 otherwise\ 0.
 .It Li kern.maxfiles ( Dv KERN_MAXFILES )
 The maximum number of open files that may be open in the system.
+This also controls the maximum file locks per unprivilegied user 
+enforced by
+.Xr fnctl 2
+and 
+.Xr flock 2 .
 .It Li kern.maxpartitions ( Dv KERN_MAXPARTITIONS )
 The maximum number of partitions allowed per disk.
 .It Li kern.maxlwp

Index: src/sys/kern/vfs_lockf.c
diff -u src/sys/kern/vfs_lockf.c:1.73 src/sys/kern/vfs_lockf.c:1.73.60.1
--- src/sys/kern/vfs_lockf.c:1.73	Mon Jan 31 08:25:32 2011
+++ src/sys/kern/vfs_lockf.c	Tue Sep  7 17:12:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_lockf.c,v 1.73 2011/01/31 08:25:32 dholland Exp $	*/
+/*	$NetBSD: vfs_lockf.c,v 1.73.60.1 2021/09/07 17:12:21 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_lockf.c,v 1.73 2011/01/31 08:25:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_lockf.c,v 1.73.60.1 2021/09/07 17:12:21 martin Exp $");
 
 #include 
 #include 
@@ -123,7 +123,7 @@ int	lockf_debug = 0;
  * so that the unlock can succeed.  If the unlocking causes too many splits,
  * however, you're totally cutoff.
  */
-int maxlocksperuid = 1024;
+#define MAXLOCKSPERUID (2 * maxfiles)
 
 #ifdef LOCKF_DEBUG
 /*
@@ -200,7 +200,7 @@ lf_alloc(int allowfail)
 	uip = uid_find(uid);
 	lcnt = atomic_inc_ulong_nv(>ui_lockcnt);
 	if (uid && allowfail && lcnt >
-	(allowfail == 1 ? maxlocksperuid : (maxlocksperuid * 2))) {
+	(allowfail == 1 ? MAXLOCKSPERUID : (MAXLOCKSPERUID * 2))) {
 		atomic_dec_ulong(>ui_lockcnt);
 		return NULL;
 	}



CVS commit: [netbsd-9] src

2021-09-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Sep  7 17:12:21 UTC 2021

Modified Files:
src/lib/libc/sys [netbsd-9]: fcntl.2 flock.2
src/share/man/man7 [netbsd-9]: sysctl.7
src/sys/kern [netbsd-9]: vfs_lockf.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1343):

share/man/man7/sysctl.7: revision 1.153
sys/kern/vfs_lockf.c: revision 1.74
lib/libc/sys/fcntl.2: revision 1.46
lib/libc/sys/flock.2: revision 1.23

Tie the maximum file lock per unprivilegied uid to kern.maxfiles

This makes the limit simple to raise at run time. While there, document
that fcntl(2) and flock(2) may return ENOMEM when this limit is reached.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.28.1 src/lib/libc/sys/fcntl.2
cvs rdiff -u -r1.22 -r1.22.44.1 src/lib/libc/sys/flock.2
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.73 -r1.73.60.1 src/sys/kern/vfs_lockf.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

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:49:51 UTC 2021

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

Log Message:
Ticket #1342


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-9.3

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.3
diff -u src/doc/CHANGES-9.3:1.1.2.25 src/doc/CHANGES-9.3:1.1.2.26
--- src/doc/CHANGES-9.3:1.1.2.25	Fri Sep  3 10:28:29 2021
+++ src/doc/CHANGES-9.3	Sun Sep  5 10:49:51 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.25 2021/09/03 10:28:29 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.26 2021/09/05 10:49:51 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -622,3 +622,9 @@ sys/arch/x86/x86/pmap.c1.410
 	xen: Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15.
 	[manu, ticket #1341]
 
+sys/arch/mips/mips/trap.c			1.250,1.251
+
+	mips: fix and disable a debug message for TLB handling.
+	[tsutsui, ticket #1342]
+
+



CVS commit: [netbsd-9] src/doc

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:49:51 UTC 2021

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

Log Message:
Ticket #1342


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-9.3

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/arch/mips/mips

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:48:48 UTC 2021

Modified Files:
src/sys/arch/mips/mips [netbsd-9]: trap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1342):

sys/arch/mips/mips/trap.c: revision 1.250
sys/arch/mips/mips/trap.c: revision 1.251

Add missing newline to a diagnostic printf.

Comment out the diagnostic message in the TLB_MOD handler that's logged if
pmap_tlb_update_addr() indicates that the VA+ASID was not found in the TLB.

It's a harmless race condition that can happen for legitimate reasons (e.g.
a TLB miss in an interrupt handler that evicts the entry from the TLB).

See discussion:
http://mail-index.netbsd.org/port-mips/2020/03/07/msg000927.html


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.249.4.1 src/sys/arch/mips/mips/trap.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/mips/mips/trap.c
diff -u src/sys/arch/mips/mips/trap.c:1.249 src/sys/arch/mips/mips/trap.c:1.249.4.1
--- src/sys/arch/mips/mips/trap.c:1.249	Sat Apr  6 11:54:20 2019
+++ src/sys/arch/mips/mips/trap.c	Sun Sep  5 10:48:48 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.249 2019/04/06 11:54:20 kamil Exp $	*/
+/*	$NetBSD: trap.c,v 1.249.4.1 2021/09/05 10:48:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.249 2019/04/06 11:54:20 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.249.4.1 2021/09/05 10:48:48 martin Exp $");
 
 #include "opt_cputype.h"	/* which mips CPU levels do we support? */
 #include "opt_ddb.h"
@@ -296,10 +296,20 @@ trap(uint32_t status, uint32_t cause, va
 		vaddr = trunc_page(vaddr);
 		int ok = pmap_tlb_update_addr(pmap, vaddr, pte, 0);
 		kpreempt_enable();
-		if (ok != 1)
+		if (ok != 1) {
+#if 0 /* PMAP_FAULTINFO? */
+			/*
+			 * Since we don't block interrupts here,
+			 * this can legitimately happen if we get
+			 * a TLB miss that's serviced in an interrupt
+			 * hander that happens to randomly evict the
+			 * TLB entry we're concerned about.
+			 */
 			printf("pmap_tlb_update_addr(%p,%#"
-			PRIxVADDR",%#"PRIxPTE", 0) returned %d",
+			PRIxVADDR",%#"PRIxPTE", 0) returned %d\n",
 			pmap, vaddr, pte_value(pte), ok);
+#endif
+		}
 		paddr_t pa = pte_to_paddr(pte);
 		KASSERTMSG(uvm_pageismanaged(pa),
 		"%#"PRIxVADDR" pa %#"PRIxPADDR, vaddr, pa);



CVS commit: [netbsd-9] src/sys/arch/mips/mips

2021-09-05 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  5 10:48:48 UTC 2021

Modified Files:
src/sys/arch/mips/mips [netbsd-9]: trap.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1342):

sys/arch/mips/mips/trap.c: revision 1.250
sys/arch/mips/mips/trap.c: revision 1.251

Add missing newline to a diagnostic printf.

Comment out the diagnostic message in the TLB_MOD handler that's logged if
pmap_tlb_update_addr() indicates that the VA+ASID was not found in the TLB.

It's a harmless race condition that can happen for legitimate reasons (e.g.
a TLB miss in an interrupt handler that evicts the entry from the TLB).

See discussion:
http://mail-index.netbsd.org/port-mips/2020/03/07/msg000927.html


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.249.4.1 src/sys/arch/mips/mips/trap.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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:28:29 UTC 2021

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

Log Message:
Tickets #1339 - #1341


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-9.3

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.3
diff -u src/doc/CHANGES-9.3:1.1.2.24 src/doc/CHANGES-9.3:1.1.2.25
--- src/doc/CHANGES-9.3:1.1.2.24	Fri Aug 20 19:33:44 2021
+++ src/doc/CHANGES-9.3	Fri Sep  3 10:28:29 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.24 2021/08/20 19:33:44 martin Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.25 2021/09/03 10:28:29 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -605,4 +605,20 @@ sys/netinet6/nd6.c1.277
 	nd6: avoid use-after-free in ND L2 cache.
 	[ozaki-r, ticket #1338]
 
+sys/dev/pci/if_vte.c1.32
+
+	vte(4): PR 53494: restore original MDC speed control register value
+	after MAC reset.
+	[andvar, ticket #1339]
+
+sys/dev/usb/ehci.c1.286
+
+	PR 56366: add missing newline and fix conditional for askroot/single
+	user hand over delay message.
+	[mrg, ticket #1340]
+
+sys/arch/x86/x86/pmap.c1.410
+
+	xen: Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15.
+	[manu, ticket #1341]
 



CVS commit: [netbsd-9] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:28:29 UTC 2021

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

Log Message:
Tickets #1339 - #1341


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.24 -r1.1.2.25 src/doc/CHANGES-9.3

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/arch/x86/x86

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:27:33 UTC 2021

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: pmap.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1341):

sys/arch/x86/x86/pmap.c: revision 1.410

Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15


To generate a diff of this commit:
cvs rdiff -u -r1.334.2.5 -r1.334.2.6 src/sys/arch/x86/x86/pmap.c

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

Modified files:

Index: src/sys/arch/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.334.2.5 src/sys/arch/x86/x86/pmap.c:1.334.2.6
--- src/sys/arch/x86/x86/pmap.c:1.334.2.5	Thu Sep  3 13:45:24 2020
+++ src/sys/arch/x86/x86/pmap.c	Fri Sep  3 10:27:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.334.2.5 2020/09/03 13:45:24 martin Exp $	*/
+/*	$NetBSD: pmap.c,v 1.334.2.6 2021/09/03 10:27:33 martin Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.334.2.5 2020/09/03 13:45:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.334.2.6 2021/09/03 10:27:33 martin Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -806,6 +806,7 @@ pmap_exec_fixup(struct vm_map *map, stru
 void
 pat_init(struct cpu_info *ci)
 {
+#ifndef XENPV
 	uint64_t pat;
 
 	if (!(ci->ci_feat_val[0] & CPUID_PAT))
@@ -819,6 +820,7 @@ pat_init(struct cpu_info *ci)
 
 	wrmsr(MSR_CR_PAT, pat);
 	cpu_pat_enabled = true;
+#endif
 }
 
 static pt_entry_t



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:27:33 UTC 2021

Modified Files:
src/sys/arch/x86/x86 [netbsd-9]: pmap.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1341):

sys/arch/x86/x86/pmap.c: revision 1.410

Make pat_init() a NOOP on XENPV; it causes a trap with Xen 4.15


To generate a diff of this commit:
cvs rdiff -u -r1.334.2.5 -r1.334.2.6 src/sys/arch/x86/x86/pmap.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/usb

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:25:36 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-9]: ehci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1340):

sys/dev/usb/ehci.c: revision 1.286

add missing newline and fix conditional for askroot/single user
hand over delay message.  PR#56366.


To generate a diff of this commit:
cvs rdiff -u -r1.267.2.4 -r1.267.2.5 src/sys/dev/usb/ehci.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/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.267.2.4 src/sys/dev/usb/ehci.c:1.267.2.5
--- src/sys/dev/usb/ehci.c:1.267.2.4	Wed Dec 23 12:34:38 2020
+++ src/sys/dev/usb/ehci.c	Fri Sep  3 10:25:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.267.2.4 2020/12/23 12:34:38 martin Exp $ */
+/*	$NetBSD: ehci.c,v 1.267.2.5 2021/09/03 10:25:36 martin Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.4 2020/12/23 12:34:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.267.2.5 2021/09/03 10:25:36 martin Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -2654,8 +2654,8 @@ ehci_disown_sched_callback(ehci_softc_t 
 	mutex_exit(>sc_complock);
 
 	config_pending_incr(sc->sc_dev);
-	aprint_normal("delaying %s by %u seconds due to USB owner change.",
-	(boothowto & RB_ASKNAME) == 0 ? "ask root" : "single user",
+	aprint_normal("delaying %s by %u seconds due to USB owner change.\n",
+	(boothowto & RB_ASKNAME) != 0 ? "ask root" : "single user",
 	ehci_disown_delay_seconds);
 }
 



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:25:36 UTC 2021

Modified Files:
src/sys/dev/usb [netbsd-9]: ehci.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1340):

sys/dev/usb/ehci.c: revision 1.286

add missing newline and fix conditional for askroot/single user
hand over delay message.  PR#56366.


To generate a diff of this commit:
cvs rdiff -u -r1.267.2.4 -r1.267.2.5 src/sys/dev/usb/ehci.c

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



CVS commit: [netbsd-8] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:24:10 UTC 2021

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

Log Message:
Ticket #1693


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.97 -r1.1.2.98 src/doc/CHANGES-8.3

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.3
diff -u src/doc/CHANGES-8.3:1.1.2.97 src/doc/CHANGES-8.3:1.1.2.98
--- src/doc/CHANGES-8.3:1.1.2.97	Fri Aug 20 19:35:59 2021
+++ src/doc/CHANGES-8.3	Fri Sep  3 10:24:09 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.97 2021/08/20 19:35:59 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.98 2021/09/03 10:24:09 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2006,3 +2006,9 @@ sys/netinet6/nd6.c1.277
 	nd6: avoid use-after-free in ND L2 cache.
 	[ozaki-r, ticket #1692]
 
+sys/dev/pci/if_vte.c1.32
+
+	vte(4): PR 53494: restore original MDC speed control register value
+	after MAC reset.
+	[andvar, ticket #1693]
+



CVS commit: [netbsd-8] src/doc

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:24:10 UTC 2021

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

Log Message:
Ticket #1693


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.97 -r1.1.2.98 src/doc/CHANGES-8.3

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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:23:18 UTC 2021

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

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1693):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/dev/pci/if_vte.c

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

Modified files:

Index: src/sys/dev/pci/if_vte.c
diff -u src/sys/dev/pci/if_vte.c:1.17.2.2 src/sys/dev/pci/if_vte.c:1.17.2.3
--- src/sys/dev/pci/if_vte.c:1.17.2.2	Wed Nov  6 10:04:47 2019
+++ src/sys/dev/pci/if_vte.c	Fri Sep  3 10:23:17 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vte.c,v 1.17.2.2 2019/11/06 10:04:47 martin Exp $	*/
+/*	$NetBSD: if_vte.c,v 1.17.2.3 2021/09/03 10:23:17 martin Exp $	*/
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.17.2.2 2019/11/06 10:04:47 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.17.2.3 2021/09/03 10:23:17 martin Exp $");
 
 #include 
 #include 
@@ -1194,9 +1194,10 @@ vte_tick(void *arg)
 static void
 vte_reset(struct vte_softc *sc)
 {
-	uint16_t mcr;
+	uint16_t mcr, mdcsc;
 	int i;
 
+	mdcsc = CSR_READ_2(sc, VTE_MDCSC);
 	mcr = CSR_READ_2(sc, VTE_MCR1);
 	CSR_WRITE_2(sc, VTE_MCR1, mcr | MCR1_MAC_RESET);
 	for (i = VTE_RESET_TIMEOUT; i > 0; i--) {
@@ -1214,6 +1215,14 @@ vte_reset(struct vte_softc *sc)
 	CSR_WRITE_2(sc, VTE_MACSM, 0x0002);
 	CSR_WRITE_2(sc, VTE_MACSM, 0);
 	DELAY(5000);
+
+	/*
+	 * On some SoCs (like Vortex86DX3) MDC speed control register value
+	 * needs to be restored to original value instead of default one,
+	 * otherwise some PHY registers may fail to be read.
+	 */
+	if (mdcsc != MDCSC_DEFAULT)
+		CSR_WRITE_2(sc, VTE_MDCSC, mdcsc);
 }
 
 



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:23:18 UTC 2021

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

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1693):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.17.2.2 -r1.17.2.3 src/sys/dev/pci/if_vte.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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:20:22 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-9]: if_vte.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1339):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/pci/if_vte.c

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

Modified files:

Index: src/sys/dev/pci/if_vte.c
diff -u src/sys/dev/pci/if_vte.c:1.26.2.1 src/sys/dev/pci/if_vte.c:1.26.2.2
--- src/sys/dev/pci/if_vte.c:1.26.2.1	Wed Nov  6 09:59:39 2019
+++ src/sys/dev/pci/if_vte.c	Fri Sep  3 10:20:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vte.c,v 1.26.2.1 2019/11/06 09:59:39 martin Exp $	*/
+/*	$NetBSD: if_vte.c,v 1.26.2.2 2021/09/03 10:20:22 martin Exp $	*/
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.26.2.1 2019/11/06 09:59:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.26.2.2 2021/09/03 10:20:22 martin Exp $");
 
 #include 
 #include 
@@ -1200,9 +1200,10 @@ vte_tick(void *arg)
 static void
 vte_reset(struct vte_softc *sc)
 {
-	uint16_t mcr;
+	uint16_t mcr, mdcsc;
 	int i;
 
+	mdcsc = CSR_READ_2(sc, VTE_MDCSC);
 	mcr = CSR_READ_2(sc, VTE_MCR1);
 	CSR_WRITE_2(sc, VTE_MCR1, mcr | MCR1_MAC_RESET);
 	for (i = VTE_RESET_TIMEOUT; i > 0; i--) {
@@ -1220,6 +1221,14 @@ vte_reset(struct vte_softc *sc)
 	CSR_WRITE_2(sc, VTE_MACSM, 0x0002);
 	CSR_WRITE_2(sc, VTE_MACSM, 0);
 	DELAY(5000);
+
+	/*
+	 * On some SoCs (like Vortex86DX3) MDC speed control register value
+	 * needs to be restored to original value instead of default one,
+	 * otherwise some PHY registers may fail to be read.
+	 */
+	if (mdcsc != MDCSC_DEFAULT)
+		CSR_WRITE_2(sc, VTE_MDCSC, mdcsc);
 }
 
 



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

2021-09-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  3 10:20:22 UTC 2021

Modified Files:
src/sys/dev/pci [netbsd-9]: if_vte.c

Log Message:
Pull up following revision(s) (requested by andvar in ticket #1339):

sys/dev/pci/if_vte.c: revision 1.32

Restore original MDC speed control register value after MAC reset, if
it wasn't default. Fixes PR port-i386/53494.

ok riastradh


To generate a diff of this commit:
cvs rdiff -u -r1.26.2.1 -r1.26.2.2 src/sys/dev/pci/if_vte.c

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



CVS commit: [netbsd-8] src/doc

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:35:59 UTC 2021

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

Log Message:
Ticket #1692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.96 -r1.1.2.97 src/doc/CHANGES-8.3

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.3
diff -u src/doc/CHANGES-8.3:1.1.2.96 src/doc/CHANGES-8.3:1.1.2.97
--- src/doc/CHANGES-8.3:1.1.2.96	Sun Aug 15 10:04:53 2021
+++ src/doc/CHANGES-8.3	Fri Aug 20 19:35:59 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.3,v 1.1.2.96 2021/08/15 10:04:53 martin Exp $
+# $NetBSD: CHANGES-8.3,v 1.1.2.97 2021/08/20 19:35:59 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2001,3 +2001,8 @@ sys/compat/common/vfs_syscalls_50.c		1.2
 	Fix compat stat(2) syscall kernel memory disclosure.
 	[christos, ticket #1691]
 
+sys/netinet6/nd6.c1.277
+
+	nd6: avoid use-after-free in ND L2 cache.
+	[ozaki-r, ticket #1692]
+



CVS commit: [netbsd-8] src/doc

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:35:59 UTC 2021

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

Log Message:
Ticket #1692


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.96 -r1.1.2.97 src/doc/CHANGES-8.3

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/netinet6

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:34:49 UTC 2021

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1692):

sys/netinet6/nd6.c: revision 1.277

nd6: prevent ln from being freed while releasing held packets


To generate a diff of this commit:
cvs rdiff -u -r1.232.2.13 -r1.232.2.14 src/sys/netinet6/nd6.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.232.2.13 src/sys/netinet6/nd6.c:1.232.2.14
--- src/sys/netinet6/nd6.c:1.232.2.13	Mon Sep 30 15:48:45 2019
+++ src/sys/netinet6/nd6.c	Fri Aug 20 19:34:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.232.2.13 2019/09/30 15:48:45 martin Exp $	*/
+/*	$NetBSD: nd6.c,v 1.232.2.14 2021/08/20 19:34:49 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.232.2.13 2019/09/30 15:48:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.232.2.14 2021/08/20 19:34:49 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2014,6 +2014,7 @@ nd6_llinfo_release_pkts(struct llentry *
 
 	m_hold = ln->la_hold, ln->la_hold = NULL, ln->la_numheld = 0;
 
+	LLE_ADDREF(ln);
 	LLE_WUNLOCK(ln);
 	for (; m_hold != NULL; m_hold = m_hold_next) {
 		m_hold_next = m_hold->m_nextpkt;
@@ -2027,6 +2028,7 @@ nd6_llinfo_release_pkts(struct llentry *
 		ip6_if_output(ifp, ifp, m_hold, , NULL);
 	}
 	LLE_WLOCK(ln);
+	LLE_REMREF(ln);
 }
 
 /*



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

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:34:49 UTC 2021

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1692):

sys/netinet6/nd6.c: revision 1.277

nd6: prevent ln from being freed while releasing held packets


To generate a diff of this commit:
cvs rdiff -u -r1.232.2.13 -r1.232.2.14 src/sys/netinet6/nd6.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

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:33:45 UTC 2021

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

Log Message:
Ticket #1338


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/CHANGES-9.3

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

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:33:45 UTC 2021

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

Log Message:
Ticket #1338


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.23 -r1.1.2.24 src/doc/CHANGES-9.3

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.3
diff -u src/doc/CHANGES-9.3:1.1.2.23 src/doc/CHANGES-9.3:1.1.2.24
--- src/doc/CHANGES-9.3:1.1.2.23	Thu Aug 19 04:53:21 2021
+++ src/doc/CHANGES-9.3	Fri Aug 20 19:33:44 2021
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.3,v 1.1.2.23 2021/08/19 04:53:21 snj Exp $
+# $NetBSD: CHANGES-9.3,v 1.1.2.24 2021/08/20 19:33:44 martin Exp $
 
 A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3
 release:
@@ -600,3 +600,9 @@ usr.sbin/sysinst/upgrade.c			1.18
 	PR 56354: make swap in sysinst optional for upgrades
 	[martin, ticket #1333]
 
+sys/netinet6/nd6.c1.277
+
+	nd6: avoid use-after-free in ND L2 cache.
+	[ozaki-r, ticket #1338]
+
+



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

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:32:49 UTC 2021

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1338):

sys/netinet6/nd6.c: revision 1.277

nd6: prevent ln from being freed while releasing held packets


To generate a diff of this commit:
cvs rdiff -u -r1.256.2.7 -r1.256.2.8 src/sys/netinet6/nd6.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.256.2.7 src/sys/netinet6/nd6.c:1.256.2.8
--- src/sys/netinet6/nd6.c:1.256.2.7	Mon Sep 30 15:55:40 2019
+++ src/sys/netinet6/nd6.c	Fri Aug 20 19:32:49 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.256.2.7 2019/09/30 15:55:40 martin Exp $	*/
+/*	$NetBSD: nd6.c,v 1.256.2.8 2021/08/20 19:32:49 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.7 2019/09/30 15:55:40 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.256.2.8 2021/08/20 19:32:49 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2036,6 +2036,7 @@ nd6_llinfo_release_pkts(struct llentry *
 
 	m_hold = ln->la_hold, ln->la_hold = NULL, ln->la_numheld = 0;
 
+	LLE_ADDREF(ln);
 	LLE_WUNLOCK(ln);
 	for (; m_hold != NULL; m_hold = m_hold_next) {
 		m_hold_next = m_hold->m_nextpkt;
@@ -2049,6 +2050,7 @@ nd6_llinfo_release_pkts(struct llentry *
 		ip6_if_output(ifp, ifp, m_hold, , NULL);
 	}
 	LLE_WLOCK(ln);
+	LLE_REMREF(ln);
 }
 
 /*



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

2021-08-20 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Aug 20 19:32:49 UTC 2021

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1338):

sys/netinet6/nd6.c: revision 1.277

nd6: prevent ln from being freed while releasing held packets


To generate a diff of this commit:
cvs rdiff -u -r1.256.2.7 -r1.256.2.8 src/sys/netinet6/nd6.c

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



Re: CVS commit: src/etc/rc.d

2021-08-02 Thread Martin Husemann
On Mon, Aug 02, 2021 at 12:44:01PM +0700, Robert Elz wrote:
> Date:Mon, 2 Aug 2021 11:54:27 +0900
> From:Rin Okuyama 
> Message-ID:  
> 
>   | Install /etc/rc.d/zfs for everyone?
> 
> Add a new dummy rc.d script (like LOGIN or DISKS)
> have devpubd come before that, and everything
> which should come later require it.
> 
> That's cleaner.   We should probably have a
> few more of them for the startup stages, even
> if they're not really needed yet, and far
> fewer real scripts depending on each other
> except where there is a genuine relationship.

Seconded, like what I did with /etc/rc.d/CRITLOCALMOUNTED recently (which also
shows the hardest part of the game: find a proper name, and beware of
case-insensitive-but-case-preserving source filesystems that we still support
cross builds from).

Martin


Re: CVS commit: src

2021-06-30 Thread Martin Husemann
On Tue, Jun 29, 2021 at 10:40:54PM +, David A. Holland wrote:
> Module Name:  src
> Committed By: dholland
> Date: Tue Jun 29 22:40:54 UTC 2021
> 
> Modified Files:
>   src/external/cddl/osnet/sys/sys: vnode.h
>   src/share/man/man9: errno.9 vnsubr.9
>   src/sys/dev: firmload.c fss.c kloader.c vnd.c
>   src/sys/kern: kern_acct.c kern_core.c kern_descrip.c kern_ktrace_vfs.c
>   kern_module_vfs.c subr_exec_fd.c subr_kobj_vfs.c tty_ptm.c
>   vfs_syscalls.c vfs_vnops.c
>   src/sys/miscfs/fdesc: fdesc_vnops.c
>   src/sys/modules/lua: lua.c
>   src/sys/sys: filedesc.h vnode.h
>   src/sys/ufs/lfs: ulfs_extattr.c ulfs_quota1.c
>   src/sys/ufs/ufs: ufs_extattr.c ufs_quota1.c
> 
> Log Message:
> Add containment for the cloning devices hack in vn_open.
> 
> Cloning devices (and also things like /dev/stderr) work by allocating
> a struct file, stuffing it in the file table (which is a layer
> violation), stuffing the file descriptor number for it in a magic
> field of struct lwp (which is gross), and then "failing" with one of
> two magic errnos, EDUPFD or EMOVEFD.

bpf seems to be completely broken after this change. At least for me on
amd64 with a monolithic kernel (neither dhcpcd nor wpa_supplicant work).

Martin


Re: slk.c still broken on some architecetures

2021-06-24 Thread Martin Husemann
On Thu, Jun 24, 2021 at 08:33:45AM -0700, Paul Goyette wrote:
> /build/netbsd-current/src_ro/lib/libcurses/slk.c: In function '__slk_wset':
> /build/netbsd-current/src_ro/lib/libcurses/slk.c:571:52: error: format '%ld' 
> expects argument of type 'long int', but argument 3 has type 'size_t' {aka 
> 'unsigned int'} [-Werror=format=]
>   571 |  __CTRACE(__CTRACE_INPUT, "__slk_wset: wcsrtombs %ld\n", len);
>   |  ~~^ ~~~
>   || |
>   || size_t {aka 
> unsigned int}
>   |long int
>   |  %d

I fixed that printf format, but the code should not be enabled in default
builds (it is #ifdef DEBUG). Somehow you must have enabled that DEBUG code.

Martin


Re: CVS commit: src/lib/libcurses

2021-06-23 Thread Martin Husemann
On Wed, Jun 23, 2021 at 07:29:30AM +, Martin Husemann wrote:
> This (or the series) broke the non-wide char builds.
> Easy/quick reproducer: build.sh -m sun2 release

/home/builds/ab/HEAD/sun3/202106222020Z-tools/lib/gcc/m68k--netbsdelf/10.3.0/../../../../m68k--netbsdelf/bin/ld:
 libhack.o: in function `__slk_draw':
/usr/src/distrib/utils/libhack/../../../lib/libcurses/slk.c:860: undefined 
reference to `setcchar'
/home/builds/ab/HEAD/sun3/202106222020Z-tools/lib/gcc/m68k--netbsdelf/10.3.0/../../../../m68k--netbsdelf/bin/ld:
 /usr/src/distrib/utils/libhack/../../../lib/libcurses/slk.c:870: undefined 
reference to `mvwins_wch'
/home/builds/ab/HEAD/sun3/202106222020Z-tools/lib/gcc/m68k--netbsdelf/10.3.0/../../../../m68k--netbsdelf/bin/ld:
 /usr/src/distrib/utils/libhack/../../../lib/libcurses/slk.c:873: undefined 
reference to `mvwadd_wch'
collect2: error: ld returned 1 exit status

See for example:

http://releng.netbsd.org/builds/HEAD/202106222020Z/sun3.build.failed


Martin


Re: CVS commit: src/lib/libcurses

2021-06-23 Thread Martin Husemann
On Tue, Jun 22, 2021 at 07:49:09AM +, Brett Lymn wrote:
> Module Name:  src
> Committed By: blymn
> Date: Tue Jun 22 07:49:09 UTC 2021
> 
> Modified Files:
>   src/lib/libcurses: addbytes.c
> 
> Log Message:
> Rework the fix for lib/56224.
> Move the scroll check to _cursesi_addwchar
> Perform the scroll check before updating the cursor location when
> processing \n.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.56 -r1.57 src/lib/libcurses/addbytes.c

This (or the series) broke the non-wide char builds.
Easy/quick reproducer: build.sh -m sun2 release

Can you please fix?

Thanks!

Martin


Re: CVS commit: src/share/misc

2021-03-30 Thread Martin Husemann
On Wed, Mar 31, 2021 at 12:38:20PM +1100, matthew green wrote:
> i already did in the other thread -- apply the existing
> () rule.  aka, avoid it unless it helps comprehension,
> which means simple sizeof can avoid it, but anything
> slightly complex should not.  this means that all the
> fun cases will use () and the specific case i won't use
> it for is left alone (snprintf(buf, sizeof buf, ...)).

I am in favor of this, for exactly that usage (i.e. passing a buffer
and its size to a function that takes a pointer / size_t argument).
However, all cases where the paranthesis pretend a different evaluation
order should be avoided anyway.


Martin


Re: CVS commit: src/sys/netinet

2021-02-16 Thread Martin Husemann
On Tue, Feb 16, 2021 at 09:29:15AM +, Roy Marples wrote:
> In my testing on aarch64 and octeon (both of which I think are strict
> alignment) neither need pullups nor copyups as the mbuf already has enough
> and arphrd is aligned correctly already.

Ah, we asserted too much alignment - indeed, this variant works and I commited
it after testing on 32bit arm and sparc64.

Martin


Re: CVS commit: src/sys/netinet

2021-02-16 Thread Martin Husemann
On Tue, Feb 16, 2021 at 08:26:40AM +, Roy Marples wrote:
> Is that because ARP_HDR_ALIGNMENT is forcing 4 byte alignment?

The KASSERT a few lines below triggerd, we need to be consistent.

> For the purposes of using just the header we define I'm pretty sure we can
> use 2 byte alignment and set ARP_HDR_ALIGNMENT to 1.

I can test (I have an alignment critical machine with non-ETHER_ALIGN'ing
network driver). Send me a patch, I lost track in the ongoing overhaul.

> ARP_HDR_ALIGNED_P can now be removed from if_arp.c as well.

Not sure I understand what you mean here.

Martin


Re: CVS commit: src/usr.bin/make

2021-01-26 Thread Martin Husemann
On Tue, Jan 26, 2021 at 11:39:52PM +0100, Roland Illig wrote:
> The code of usr.bin/make gets distributed to a wider audience by Simon's
> bmake distribution (http://www.crufty.net/help/sjg/bmake.html), that's
> where the requirement of supporting C89 compilers comes from.  At the
> time I committed this fix, Simon had managed to dig out an old Solaris 9
> installation with GCC, and these few changes were the only ones needed
> to let bmake run on that platform.  That sounded easy enough to me.

Also note that we need bmake during bootstrap of pkgsrc, and besides
finding a working compiler it is one of the early things you need to
make work on an ancient platform if you try to bring it to new use (I
have been there with Solaris 2.6 at one point, but gave up for other
reasons - and of course the machine in question now runs NetBSD (again)
[the Solaris adventure was a temporary thing anyway and as pkgsrc did
not help as a "plug and play" way to get a usable dev/debug environment
it was not worth pushing]).

But I must admit that the *commit log* of that change sounded way more scary
than the actual change is:

replace %zu with %u in printf calls

would be plain wrong and of course break (either at runtime or if lucky
at compile time) many, many platforms.

But

-   (void)fprintf(f, "\"%s\" line %zu: ", fname, lineno);
+   (void)fprintf(f, "\"%s\" line %u: ", fname, (unsigned)lineno);

is ok for portable code and "lineno" referencing (I guess) a makefile.
It could have been (long unsigned) and "%lu", but maybe portability to
systems where that would make a difference is a bit far stretched.

Martin


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

2021-01-24 Thread Martin Husemann
On Sun, Jan 24, 2021 at 09:45:14PM -0800, Jason Thorpe wrote:
> 
> > On Jan 24, 2021, at 9:37 PM, Martin Husemann  wrote:
> > 
> > While I don't care for names, I would like to understand fallout in
> > details before hiding it - what exactly did not compile correctly?
> > At least the affected arm kernels worked for me in the state directly
> > before your commit.
> 
> I kept getting a ?static after non-static declaration? error when building 
> for aarch64.

I guess that was with outdated arm/include/bus_funcs.h and
sys/bus_proto.h (or where was the previous declaration)?

Martin


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

2021-01-24 Thread Martin Husemann
On Sun, Jan 24, 2021 at 03:34:08PM +, Jason R Thorpe wrote:
> Module Name:  src
> Committed By: thorpej
> Date: Sun Jan 24 15:34:08 UTC 2021
> 
> Modified Files:
>   src/sys/dev/pci: virtio_pci.c
> 
> Log Message:
> Redefining bus_space functions in drivers is a bad idea, and we just
> should't be in the habit of doing so.  Besides, the previous "solutions"
> still did not compile correctly, and this does, so let's be done with
> this nonsense, shall we?

While I don't care for names, I would like to understand fallout in
details before hiding it - what exactly did not compile correctly?
At least the affected arm kernels worked for me in the state directly
before your commit.

Martin


Re: CVS commit: src/sys/dev

2021-01-21 Thread Martin Husemann
On Wed, Jan 20, 2021 at 07:46:48PM +, Reinoud Zandijk wrote:
> Module Name:  src
> Committed By: reinoud
> Date: Wed Jan 20 19:46:48 UTC 2021
>
[..] 
> Log Message:
> Add VirtIO PCI v1.0 attachments and fix the drivers affected.
> 
> * virtio on sparc64 attaches but is it not functioning though not a
>   regression.

While not a regression by this commit, it *did* work in netbsd-8,
so overall a bad regression that we should fix.

Martin


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

2021-01-20 Thread Martin Husemann
On Tue, Jan 19, 2021 at 07:19:51PM +0100, Martin Husemann wrote:
> On Tue, Jan 19, 2021 at 12:35:10AM +, Jason R Thorpe wrote:
> > Module Name:src
> > Committed By:   thorpej
> > Date:   Tue Jan 19 00:35:10 UTC 2021
> > 
> > Modified Files:
> > src/sys/arch/arm/sunxi: sunxi_sramc.c
> > 
> > Log Message:
> > Use device_compatible_entry / of_search_compatible() rather than matching
> > against multiple sets of compatibility strings.
> > 
> > 
> > To generate a diff of this commit:
> > cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sunxi_sramc.c
> 
> This breaks cubietruck (fdt is: sun7i-a20-cubietruck.dtb):

And it was fixed with

$NetBSD: sunxi_sramc.c,v 1.7 2021/01/20 00:48:49 jmcneill Exp $

Martin


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

2021-01-19 Thread Martin Husemann
On Tue, Jan 19, 2021 at 12:35:10AM +, Jason R Thorpe wrote:
> Module Name:  src
> Committed By: thorpej
> Date: Tue Jan 19 00:35:10 UTC 2021
> 
> Modified Files:
>   src/sys/arch/arm/sunxi: sunxi_sramc.c
> 
> Log Message:
> Use device_compatible_entry / of_search_compatible() rather than matching
> against multiple sets of compatibility strings.
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sunxi_sramc.c

This breaks cubietruck (fdt is: sun7i-a20-cubietruck.dtb):


[   1.000] fclock0 at simplebus2: 2500 Hz fixed clock (mii_phy_tx)
[   1.000] fclock1 at simplebus2: 12500 Hz fixed clock (gmac_int_tx)
[   1.000] fclock2 at simplebus2: 2400 Hz fixed clock (osc24M)
[   1.000] fclock3 at simplebus2: 32768 Hz fixed clock (osc32k)
[   1.000] gtmr0 at simplebus0: Generic Timer
[   1.000] gtmr0: interrupting on GIC irq 27
[   1.000] armgtmr0 at gtmr0: Generic Timer (24000 kHz, virtual)
[   1.030] sun4ia10ccu0 at simplebus1: A20 CCU
[   1.030] sunxinmi0 at simplebus1: NMI
[   1.030] sunxigmacclk0 at simplebus2: GMAC MII/RGMII clock mux
[   1.030] sunxigpio0 at simplebus1: PIO
[   1.030] gpio0 at sunxigpio0: 175 pins
[   1.030] sunxigpio0: interrupting on GIC irq 60
[   1.030] sun4idma0 at simplebus1: DMA controller
[   1.030] sun4idma0: interrupting on GIC irq 59
[   1.030] sunxisramc0 at simplebus1: SRAM Controller

[   1.030] uvm_fault(0x80b92d68, 0, 1) -> e
[   1.030] Fatal kernel mode data abort: 'Translation Fault (S)'
[   1.030] trapframe: 0x80bc8cf0
[   1.030] FSR=0005, FAR=, spsr=6353
[   1.030] r0 =92cfd200, r1 =806b0910, r2 =, r3 =
[   1.030] r4 =92a0cd00, r5 =10c4, r6 =92cfd200, r7 =0dd0
[   1.030] r8 =806b0910, r9 =114c, r10=80634a80, r11=80bc8d94
[   1.030] r12=92cf3988, ssp=80bc8d40, slr=804bc688, pc =80061fac

Stopped in pid 0.0 (system) at  netbsd:sunxi_sramc_attach+0x16c:ldr 
r2, [r2]


(gdb) list *(sunxi_sramc_attach+0x16c)
0x80061fac is in sunxi_sramc_attach 
(../../../../arch/arm/sunxi/sunxi_sramc.c:135).
130 if (dce != NULL) {
131 node = kmem_alloc(sizeof(*node), KM_SLEEP);
132 node->phandle = child;
133 node->area = dce->data;
134 TAILQ_INSERT_TAIL(>sc_nodes, node, nodes);
135 aprint_verbose_dev(sc->sc_dev, "area: %s\n",
136 node->area->desc);
137 }
138 }
139 }


With the change backed out it boots fine (dmesg below).

Martin

--8<--

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
2018, 2019, 2020, 2021 The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.

NetBSD 9.99.78 (GENERIC) #117: Tue Jan 19 19:14:10 CET 2021

mar...@seven-days-to-the-wolves.aprisoft.de:/work/src/sys/arch/evbarm/compile/GENERIC
total memory = 2045 MB
avail memory = 1989 MB
entropy: no seed from bootloader
timecounter: Timecounters tick every 10.000 msec
Kernelized RAIDframe activated
armfdt0 (root)
simplebus0 at armfdt0: Cubietech Cubietruck
simplebus1 at simplebus0
cpus0 at simplebus0
simplebus2 at simplebus0
simplebus3 at simplebus0
cpu0 at cpus0: Cortex-A7 r0p4 (Cortex V7A core)
cpu0: DC enabled IC enabled WB enabled LABT branch prediction enabled
cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
cpu0: 256KB/64B 8-way write-through L2 PIPT Unified cache
vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
cpufreqdt0 at cpu0
cpu1 at cpus0
cpufreqdt1 at cpu1
gic0 at simplebus1: GIC
armgic0 at gic0: Generic Interrupt Controller, 160 sources (150 valid)
armgic0: 16 Priorities, 128 SPIs, 7 PPIs, 15 SGIs
fclock0 at simplebus2: 2500 Hz fixed clock (mii_phy_tx)
fclock1 at simplebus2: 12500 Hz fixed clock (gmac_int_tx)
fclock2 at simplebus2: 2400 Hz fixed clock (osc24M)
fclock3 at simplebus2: 32768 Hz fixed clock (osc32k)
gtmr0 at simplebus0: Generic Timer
gtmr0: interrupting on GIC irq 27
armgtmr0 at gtmr0: Generic Timer (24000 kHz, virtual)
timecounter: Timecounter "armgtmr0" frequency 2400 Hz quality 500
sun4ia10ccu0 at simplebus1: A20 CCU
sunxinmi0 at simplebus1: NMI
sunxigmacclk0 at simplebus2: GMAC MII/RGMII clock mux
sunxigpio0 at simplebus1: PIO
gpio0 at sunxigpio0: 175 pins
sunxigpio0: interrupting on GIC irq 60
sun4idma0 at simplebus1: DMA controller
sun4idma0: interrupting on GIC irq 59
sunxisramc0 at simplebus1: SRAM Controller
sunxisramc0: area: SRAM A3/A4
sunxisramc0: area: SRAM D
sunxidebe0 at simplebus1: Display Engine Backend (display-backend@1e6)

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

2021-01-09 Thread Martin Husemann
On Sat, Jan 09, 2021 at 05:15:12PM +0100, Roland Illig wrote:
> I guess a simple "make clean && make" will clear up the situation.

Not quite, "make clean" will not remove the old ops.c file in the objdir,
you need to manually kill it (or just remove all lint objdirs completely).

Please add an entry to src/UPDATING, I would suggest something like:

find $OBJDIR -type d -name \*lint\* | xargs rm -rf

Martin


Re: CVS commit: src

2020-11-12 Thread Martin Husemann
On Thu, Nov 12, 2020 at 07:58:13PM +, Taylor R Campbell wrote:
> But there's a snag with heimdal.
> 
> Heimdal exposes the sqlite3 library to clients via libgssapi.so which
> links against libkrb5.so which brings in libsqlite3.so.  So we get nice
> situations like this:
> 
> % ldd /pkg/2020Q2/bin/svn | grep sqlite   
> -lsqlite3.0 => /pkg/2020Q2/lib/libsqlite3.so.0
> -lsqlite3.1 => /usr/lib/libsqlite3.so.1
> 
> This is also why the change to base sqlite3 affected, e.g., su(1).

How about making sqlite3 just a private lib statically linked into whatever
part of heimdahl actually needs it, and not exposing any symbols from it?

Martin


Re: CVS commit: src/sys

2020-11-04 Thread Martin Husemann
On Wed, Nov 04, 2020 at 05:33:29AM -0800, Paul Goyette wrote:
> I guess I don't understand why a 32-bit architecture would also have
> COMPAT_NETBSD32.

(At least) mips and arm have various 32bit ABIs that are handled by
COMPAT_NETBSD32.

Martin


Re: CVS commit: [netbsd-9] src

2020-10-17 Thread Martin Husemann
On Fri, Oct 16, 2020 at 08:17:09AM +, Martin Husemann wrote:
> Module Name:  src
> Committed By: martin
> Date: Fri Oct 16 08:17:09 UTC 2020
> 
> Modified Files:
>   src/doc [netbsd-9]: CHANGES-9.1
>   src/external/gpl2/groff/tmac [netbsd-9]: mdoc.local
>   src/sys/sys [netbsd-9]: param.h
> 
> Log Message:
> Welcome to 9.1!

Just in case anyone is wondering - this version did not survive internal QA,
we will move the tag for some files and have a slightly different 9.1 -
hopefully soon. This is why no official binaries are available and there
was no anouncement yet.

Martin


Re: CVS commit: src

2020-10-15 Thread Martin Husemann
On Thu, Oct 15, 2020 at 05:44:45PM +, Micha? G?rny wrote:
> Module Name:  src
> Committed By: mgorny
> Date: Thu Oct 15 17:44:45 UTC 2020
> 
> Modified Files:
>   src/distrib/sets/lists/tests: mi
>   src/etc/mtree: NetBSD.dist.tests
>   src/tests/sys: Makefile
> Added Files:
>   src/tests/sys/x86: Makefile t_convert_xmm_s87.c
> 
> Log Message:
> Add tests for process_xmm_to_s87() and process_s87_to_xmm()

This breaks all non-x86 builds, you need to consistently use the same
conditions for the makefiles, set lists and mtree files.

Probably easiest way out: create the directories always (but leave empty
on non-x86). Alternative: do not use arch specific sub dirs.

Martin


Re: CVS commit: src/external/gpl3/gcc/dist/gcc/config/aarch64

2020-10-15 Thread Martin Husemann
On Thu, Oct 15, 2020 at 05:28:12PM +1100, matthew green wrote:
> you could try reverting most of our changes to this file and
> making sure you run with /proc mounted -o linux.  ryo@ recently
> added additional /proc/cpuinfo support that should make this
> just work with the upstream version, but i haven't had chance
> to update and see if this is the case.

If we go this route, we should make the relevant procfs nodes independent
of -o linux.

Martin


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

2020-10-13 Thread Martin Husemann
On Tue, Oct 13, 2020 at 12:57:44PM +0200, Kamil Rytarowski wrote:
> > Log Message:
> > BE32 binaries are no longer supported for ARMv7 and later, and
> > therefore for aarch64eb.
> > 
> > Reject them with ENOEXEC, rather than causing illegal instruction
> > exceptions due to unexpected binary format.

> Not supported in general or on NetBSD? Big Endian 32bit is supported on
> Cavium ThunderX (at least on a selection of models if not all of them).

The new supported format is BE-8 (BE-32 is the legacy format used for big
endian arm upto v4). All newer arm either were LE only or supported BE-8 and
little endian.

Martin


Re: CVS commit: src/usr.sbin/sysinst

2020-10-12 Thread Martin Husemann
On Tue, Oct 13, 2020 at 12:15:58AM +0900, Izumi Tsutsui wrote:
> IIRC I added it to avoid users from accidentally destroy existing native
> Windows partition (for NetBSD/arc that initially required FAT partition).

I see. If needed we can add more safety checks when setting the newfs flag
(like we do in other places: silently run fsck_$fs -p) - but the way it was
now caused tricky fallout when the kernel was able to mount the new EFI
boot partition (due to a previous FAT partition starting at the same spot),
but copying the EFI bootloaders failed.

Martin


Re: GCC TSan (Re: CVS commit: src/tests/usr.bin)

2020-09-15 Thread Martin Husemann
On Tue, Sep 15, 2020 at 03:32:25PM +0200, Kamil Rytarowski wrote:
> I've tried to mark the TSan parts that need porting as explicit failure,
> soo we can reduce the risk of shipping unported runtime.

That risc is quite low as currently the runtime is apparently not buildable
on anything but amd64 ;-)

Indeed once we are able to build runtime components we should also
adjust the tested architectures. Would be great if we could easily query
such things, but it is not even easy to conditionalize the tests on gcc
9 or newer.

Martin


Re: CVS commit: src/tests/usr.bin

2020-09-14 Thread Martin Husemann
On Mon, Sep 14, 2020 at 03:17:53PM +, Kamil Rytarowski wrote:
> Enable TSan tests for GCC and >32bit address space environments

Since tsan does not work on all architectures, this is not a good idea.
It would be better to code it with an explicit list of architectures
supported.

Martin


Re: CVS commit: src

2020-09-08 Thread Martin Husemann
On Tue, Sep 08, 2020 at 09:40:47AM -0300, Jared McNeill wrote:
> This causes issues with the source tree on case insensitive file-systems :(

Sorry, should be fixed.

Martin


Re: CVS commit: src/sys/dev/mii (PR/kern 55538)

2020-08-27 Thread Martin Husemann
On Mon, Aug 24, 2020 at 12:46:04PM +, Frank Kardel wrote:
> Module Name:  src
> Committed By: kardel
> Date: Mon Aug 24 12:46:04 UTC 2020
> 
> Modified Files:
>   src/sys/dev/mii: mii_physubr.c
> 
> Log Message:
> Keep the change check invariant intact. The previous code could miss
> status updates by picking up a new status different from the tested
> status. This left addresses in the DETACHED state although the
> link status is already UP again.
> 
> addresses PR/kern 55538
> 
> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.92 -r1.93 src/sys/dev/mii/mii_physubr.c

Hi Frank,

this change breaks the network on my macppc, with r1.93 it only seems to be
able to send packets, but never receives answers (ARP does not complete,
but other hosts see the ARP requests).

gem0 at pci2 dev 15 function 0: Apple Computer GMAC Ethernet (rev. 0x01)
gem0: interrupting at irq 41
brgphy0 at gem0 phy 0: BCM5411 1000BASE-T media interface, rev. 1
brgphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 
1000baseT-FDX, auto
gem0: Ethernet address 00:03:93:71:ff:cc, 10KB RX fifo, 4KB TX fifo

It is connected to a gige switch:

media: Ethernet autoselect (1000baseT full-duplex,master)
status: active

(which looks the same in the non-working kernel).

Any ideas how to debug?

Martin


Re: CVS commit: [netbsd-9] src/doc

2020-08-17 Thread Martin Husemann
On Mon, Aug 17, 2020 at 11:10:39PM +0900, Izumi Tsutsui wrote:
> >> +xsrc/external/mit/xorg-server/dist/fb/fb.h1.3
> >> +xsrc/external/mit/xorg-server/dist/fb/fbfill.c1.2,1.3
> 
> This should be only 1.2 (no 1.3 yet).
> 
> >> +xsrc/external/mit/xorg-server/dist/fb/fbtile.c1.1-1.3
> 
> Maybe only 1.3 is enough (1.2 was file removal).

Both adjusted, thanks!

(The scripts deal not very well with vendor branches or source changes mails
referenced in commit messages)

Martin


Re: CVS commit: src/share/man/man8

2020-08-16 Thread Martin Husemann
On Sat, Aug 15, 2020 at 04:12:40PM +0200, Leonardo Taccari wrote:
> Can this use cdn.NetBSD.org and made a bit more general instead of
> hardcoding version/port please?

Maybe create a distinct "manually install pkgin" landing page with
enough magic/ links to guide the user to the "best" repo on our web
site and point the man page to that static url?

Martin


Re: CVS commit: src

2020-08-16 Thread Martin Husemann
Hi Nia,

I think you are mixing a few issues here into one discussion - which might
make sense from a user perspective, but does not help us to get forward.

>From my POV the interacting-but-need-to-be-solved-individually issues
are:

 - The libc or kernel<->userland API. This is what the core decision was
   about. The API is well (enough) defined, same on multiple OSes,
   and provides all the flexibility we need.

 - Making entropy available "early enough" during the boot process. This
   is a hard problem on *many* machines, but no big deal at all on modern
   x86 and a few modern aarch64.
   For me this is looks like still work in progress with no "good enough"
   solution yet. I understood Taylor would like to improve this next.
   I personally would define "early enough" as "during rc.d" and this makes
   the problem relatively easily solvable for "real installations" (see
   below) by just manually (or "someway") seeding the individual installations
   entropy file.
   IIUC Taylor would like to also enhance/add kernel parts providing entropy.

 - Related to above: how to deal with one-off setups like first boots of
   install images or clones of virtual machines.
   This will be solvable (probably by a combination of better scripting
   and/or documented "best practices") once the point above is more or
   less settled.

 - Finaly the grey area of "which variant of our API should applications
   use" (and even more complex: libraries). This needs individual answers
   on a case by case basis and might need some upstream battle - but we
   should be able to give good guidance and clear rules once the items
   above are cleared.

Martin


Re: CVS commit: src/sys/dev/scsipi

2020-07-11 Thread Martin Husemann
On Sat, Jul 11, 2020 at 06:24:51PM +0300, Kimmo Suominen wrote:
> I think all real SCSI hardware I've had has always just only had LUN 0,
> and each disk has been on its own SCSI ID (target).

Yes, I confused ID and LUN here - just ignore me.

Martin


Re: CVS commit: src/sys/dev/scsipi

2020-07-11 Thread Martin Husemann
On Sat, Jul 11, 2020 at 05:57:46PM +0300, Kimmo Suominen wrote:
> On Sat, Jul 11, 2020 at 05:47:34PM +0300, Jukka Ruohonen wrote:
> > I'd reckon a pullup to NetBSD 9 would be in order?
> 
> Yes, I was just waiting to be able to link to mail-index.  I had
> already checked that the patch applies cleanly to both netbsd-9
> and netbsd-8.

I don't understand the change. When was this broken? This has always worked
for me e.g. with the sd0 at LUN 3 and the controller at 6 or 7.

Or is there something special in your setup?

Martin


Re: CVS commit: src/sys

2020-07-08 Thread Martin Husemann
On Tue, Jul 07, 2020 at 03:38:49AM +, Jason R Thorpe wrote:
>   Provide a new resource provider API:

This is *extremly* verbose and overflows message buffer, can you move the
new messages to aprint_debug or ifdef with some proper DEBUG_* please?

Martin


Re: CVS commit: src/sys/arch/ia64/stand/ia64/efi

2020-07-02 Thread Martin Husemann
On Thu, Jul 02, 2020 at 08:03:09AM -0700, scole_mail wrote:
> That change didn't work:
> 
> http://releng.netbsd.org/builds/HEAD/202007020210Z/ia64.build.failed
>  ...
>  nbmake[10]: nbmake[10]: don't know how to make loader.efi.c. Stop


That build pre-dates Luke's fix.

Martin


Re: CVS commit: src/tests/lib/libarchive

2020-06-16 Thread Martin Husemann
On Tue, Jun 16, 2020 at 09:12:40AM -0700, Paul Goyette wrote:
> It might be better to run the test in a rump-kernel rather than in a
> "live" environment

The test this is about is a plain userland test:

it extracts/compresses/decompresses various archive formats and compares
results.

Only thing "special" is that it is in big parts cpu bound, and multi-threaded.

If NetBSD can not gracefully deal with that, something is very wrong
(which since about a month it is). This PR is on the "must be fixed before
branching netbsd-10" list, and I hope it will be fixed quickly.

Martin


Re: CVS commit: src/tests/lib/libarchive

2020-06-16 Thread Martin Husemann
On Tue, Jun 16, 2020 at 03:38:26PM -, Christos Zoulas wrote:
> So we are saying that it is ok for process running with regular priority,
> to be able to starve another process at the same priority from getting
> any runtime for 21 seconds in a uniprocessor kernel, and this does not
> indicate any problem with the scheduler implementation? This would mean
> that for a HZ=100 kernel in 2100 rescheduling opportunities, the watchdog
> thread was never selected to run?

No, that is definitively not OK, which is what the PR is about.

It is not OK for a regular atf run to cause a reboot of the test machine
though, so this is a temporary hack around the issue (and admitedly a very
ugly hack).

Martin


Re: CVS commit: src/lib/libpthread

2020-06-04 Thread Martin Husemann
On Wed, Jun 03, 2020 at 10:10:24PM +, Andrew Doran wrote:
> Module Name:  src
> Committed By: ad
> Date: Wed Jun  3 22:10:24 UTC 2020
> 
> Modified Files:
>   src/lib/libpthread: pthread.c pthread_cond.c pthread_mutex.c
> 
> Log Message:
> Deal with a couple of problems with threads being awoken early due to
> timeouts or cancellation where:

Not sure if it is caused by this commit or joergs TSD/malloc, but today
most of the libpthread tests time out on aarch64, while everything but
a few minor nits was fine on May 30.

Martin

(this is on a hummingboard pulse 4-core board)
lib/libpthread/t_barrier (398/848): 1 test cases
barrier: [300.034098s] Failed: Test case timed out after 300 seconds
[300.034568s]

lib/libpthread/t_cond (399/848): 9 test cases
bogus_timedwaits: [300.016677s] Failed: Test case timed out after 300 
seconds
broadcast: [300.023040s] Failed: Test case timed out after 300 seconds
cond_timedwait_race: [300.034567s] Failed: Test case timed out after 300 
seconds
condattr: [0.013756s] Passed.
destroy_after_cancel: [300.025649s] Failed: Test case timed out after 300 
seconds
signal_before_unlock: [300.023630s] Failed: Test case timed out after 300 
seconds
signal_before_unlock_static_init: [300.022909s] Failed: Test case timed out 
after 300 seconds
signal_delay_wait: [300.031310s] Failed: Test case timed out after 300 
seconds
signal_wait_race: [300.025552s] Failed: Test case timed out after 300 
seconds
[2400.221956s]

lib/libpthread/t_condwait (400/848): 2 test cases
cond_wait_mono: [2.023083s] Passed.
cond_wait_real: [2.017972s] Passed.
[4.042078s]

lib/libpthread/t_detach (401/848): 1 test cases
pthread_detach: [300.021242s] Failed: Test case timed out after 300 seconds
[300.021708s]

lib/libpthread/t_equal (402/848): 1 test cases
pthread_equal: [300.027646s] Failed: Test case timed out after 300 seconds
[300.028295s]

lib/libpthread/t_fork (403/848): 1 test cases
fork: [300.018077s] Failed: Test case timed out after 300 seconds
[300.018975s]

lib/libpthread/t_fpu (404/848): 1 test cases
fpu: [0.020578s] Passed.
[0.021314s]

lib/libpthread/t_join (405/848): 1 test cases
pthread_join: [0.021632s] Passed.
[0.022411s]

lib/libpthread/t_kill (406/848): 1 test cases
simple: [300.033759s] Failed: Test case timed out after 300 seconds
[300.034528s]

lib/libpthread/t_mutex (407/848): 7 test cases
mutex1: [300.017542s] Failed: Test case timed out after 300 seconds
mutex2: [300.023064s] Failed: Test case timed out after 300 seconds
mutex3: [300.023259s] Failed: Test case timed out after 300 seconds
mutex4: [300.023015s] Failed: Test case timed out after 300 seconds
mutex5: [300.023495s] Failed: Test case timed out after 300 seconds
mutexattr1: [0.013769s] Passed.
mutexattr2: [0.025483s] Passed.
[1500.154160s]

lib/libpthread/t_name (408/848): 1 test cases
name: [0.014262s] Passed.
[0.014951s]

...


Re: CVS commit: src

2020-05-10 Thread Martin Husemann
On Sun, May 10, 2020 at 04:18:54PM +0200, Yorick Hardy wrote:
> I think it may be better in the Makefile, since the test for amd64 already
> happens there and because the libi386 directory could conceivably
> also contain i386/non-amd64 tests.
> 
> I successfully completed a build with MKCOMPAT=no, using the patch below.
> Is it okay to commit?

Looks good to me, thanks!

Martin


Re: CVS commit: src

2020-05-07 Thread Martin Husemann
On Thu, May 07, 2020 at 10:52:26PM +0200, Yorick Hardy wrote:
> Thanks! It took a while for this to sink in ...
> 
> So I think the test should only be built if MKCOMPAT=yes ?
> (It does fail to build for me, because I usually have MKCOMPAT=no).

Yes, either the Makefile needs a conditional, or the SUBDIR+= in the
makefile above.

Martin


Re: CVS commit: src

2020-05-06 Thread Martin Husemann
On Thu, May 07, 2020 at 12:31:12AM +0200, Yorick Hardy wrote:
> I think this test depends on MKCOMPAT=yes. Does the attached the patch
> below look reasonable?
[..]
> -.if ${MACHINE} == "amd64"
> +.if ${MACHINE} == "amd64" && ${MKCOMPATTESTS} == "yes"

MKCOMPATTESTS is something slightly different. It is used to build e.g. the
"native" i386 tests (as 32bit binaries) when building an amd64 distribution.

This is usually set to "no".

MKCOMPAT=yes means to build i386 libraries, so you can build 32bit binaries
on amd64 with -m32. It is usually set to "yes".

Martin


Re: CVS commit: src/sys

2020-04-07 Thread Martin Husemann
On Tue, Apr 07, 2020 at 02:50:25PM +0900, Tetsuya Isaki wrote:
> In this case, yds(4) is attached at 5msec automatically.
> When attaching, audio layer calculates the blocksize from
> AUDI_BLK_MS etc and query it to MD driver (this is round_blocksize
> in audio(9)).  If the requested size is too small (or too large)
> for the MD driver, it will return alternative blocksize.  If audio
> layer can accept it, then use it.
> Is this right?

Yes, that sounds good.

Martin


Re: CVS commit: src/sys

2020-04-03 Thread Martin Husemann
On Fri, Apr 03, 2020 at 11:40:08PM +0900, Tetsuya Isaki wrote:
> I don't think so.  Each driver/hardware may have their specific
> restrictions.  Some driver/hardware may be able to set at 1msec
> but others may not.  It's nature.  And this is also why we
> should not be eager to reduce default blk_ms.

What I meant is that the generic audio system may have a way to query
the concrete driver(s) in use for a minimum value they support, and then
auto-scales the blk_ms appropriately.

Martin


Re: CVS commit: src/sys

2020-04-03 Thread Martin Husemann
On Fri, Apr 03, 2020 at 09:45:20PM +0900, Tetsuya Isaki wrote:
>  [*] On my alpha (500MHz), wss(4)/ISA works even on blk_ms=1.
>  But I was not able to set 1msec on yds(4) PCI sound card on
>  the same machine.  Its lower limit was 5msec (due to driver's
>  or hardware's restriction, I don't know details though).

Should we allow the driver to set a lower minimum for this?
Then all m68k and vax drivers could just request (say) 100ms and we are 
done?

Martin


Re: CVS commit: src/external/gpl3

2020-03-28 Thread Martin Husemann
On Sat, Mar 28, 2020 at 03:39:34PM +1100, matthew green wrote:
> we want both changes (libiberty, and my stdio.h/P_tmpdir
> change.)  we want to support old netbsd, non-netbsd, ..
> whatever build hosts.

Can we have them in 8.2 please?

Martin


Re: CVS commit: src/sys

2020-03-28 Thread Martin Husemann
On Sat, Mar 28, 2020 at 09:34:11AM +, nia wrote:
> > - It's not good idea to set such parameter in individual GENERICs.
> 
> It's not a good idea to punish the majority of NetBSD users because m68k
> is incredibly slow.

Both statements are true, and the latter is based on a misunderstanding.

It would be good to have a file somewhere in the audio code where the
default is selected based on some ifdefs - if we don't have anything
better something like:

#if defined(__m68k__) || defined(__vax__) || \
(defined(__sparc__) && !defined(_LP64)

#else
... 4ms
#endif

Or create (if we don't have yet) a  and define it there.

You can make it overridabel in individual kernel config files - but the
default should be sane.

Martin


  1   2   3   4   5   6   7   8   9   10   >