Re: CVS commit: src/sys/net

2022-10-24 Thread Masanobu SAITOH



On 2022/10/25 14:51, matthew green wrote:
> "SAITOH Masanobu" writes:
>> Module Name: src
>> Committed By:msaitoh
>> Date:Mon Oct 24 07:45:44 UTC 2022
>>
>> Modified Files:
>>  src/sys/net: if_dl.h
>>
>> Log Message:
>> Increase sdl_data so that more then IFNAMSIZ bytes are available.
>>
>>  - Increase the size of dl_data[] from 12 to 24.
>>  - Same as OpenBSD.
> 
> isn't this a binary compat issue?  eg, 'struct sockaddr_dl' changes,
> and that, and things based upon it, are in user interfaces.  i had
> a look and i believe it's a problem, but maybe i missed something.
> 
> thanks.
> 
> 
> .mrg.

struct dl_addr is at the end of struct sockaddr_dl.
dl_data is at the end of struct dl_addr.
So I think it's has no problem for old binaries.

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


re: CVS commit: src/sys/net

2022-10-24 Thread matthew green
"SAITOH Masanobu" writes:
> Module Name:  src
> Committed By: msaitoh
> Date: Mon Oct 24 07:45:44 UTC 2022
>
> Modified Files:
>   src/sys/net: if_dl.h
>
> Log Message:
> Increase sdl_data so that more then IFNAMSIZ bytes are available.
>
>  - Increase the size of dl_data[] from 12 to 24.
>  - Same as OpenBSD.

isn't this a binary compat issue?  eg, 'struct sockaddr_dl' changes,
and that, and things based upon it, are in user interfaces.  i had
a look and i believe it's a problem, but maybe i missed something.

thanks.


.mrg.


CVS commit: src/share/man/man9

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 25 00:20:36 UTC 2022

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

Log Message:
ifq_drops was changed to use uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/altq.9

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

Modified files:

Index: src/share/man/man9/altq.9
diff -u src/share/man/man9/altq.9:1.18 src/share/man/man9/altq.9:1.19
--- src/share/man/man9/altq.9:1.18	Thu May 26 14:39:30 2022
+++ src/share/man/man9/altq.9	Tue Oct 25 00:20:36 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: altq.9,v 1.18 2022/05/26 14:39:30 rillig Exp $
+.\"	$NetBSD: altq.9,v 1.19 2022/10/25 00:20:36 msaitoh Exp $
 .\"	$OpenBSD: altq.9,v 1.4 2001/07/12 12:41:42 itojun Exp $
 .\"
 .\" Copyright (C) 2001
@@ -25,7 +25,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd May 26, 2022
+.Dd October 24, 2022
 .Dt ALTQ 9
 .Os
 .\"
@@ -169,7 +169,7 @@ these fields.)
 struct mbuf *ifq_tail; |struct mbuf *ifq_tail;
 int  ifq_len;  |int  ifq_len;
 int  ifq_maxlen;   |int  ifq_maxlen;
-int  ifq_drops;|int  ifq_drops;
+uint64_t ifq_drops;|uint64_t ifq_drops;
  };|/* altq related fields */
|..
| };



CVS commit: src/share/man/man9

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Oct 25 00:20:36 UTC 2022

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

Log Message:
ifq_drops was changed to use uint64_t.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/share/man/man9/altq.9

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



CVS commit: src/lib/libc/time

2022-10-24 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 24 23:18:31 UTC 2022

Modified Files:
src/lib/libc/time: strptime.3

Log Message:
strptime(3): make the fact that %z is an extension more prominent

Mention it near the format itself, not on the next screen (with an
awkward indentation too).


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libc/time/strptime.3

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/time/strptime.3
diff -u src/lib/libc/time/strptime.3:1.37 src/lib/libc/time/strptime.3:1.38
--- src/lib/libc/time/strptime.3:1.37	Sun Feb 24 11:51:05 2019
+++ src/lib/libc/time/strptime.3	Mon Oct 24 23:18:31 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: strptime.3,v 1.37 2019/02/24 11:51:05 maya Exp $
+.\"	$NetBSD: strptime.3,v 1.38 2022/10/24 23:18:31 uwe Exp $
 .\"
 .\" Copyright (c) 1997, 1998, 2008 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -222,6 +222,11 @@ with \&%C, specifies the year [0,99] wit
 the year, including the century (i.e., 1996).
 .It Cm \&%z
 an ISO 8601, RFC-2822, or RFC-3339 time zone specification.
+.Po
+A
+.Nx
+extension.
+.Pc
 This is one of the following:
 .Bl -dash -offset indent -compact
 .It
@@ -312,11 +317,6 @@ through
 .It
 An arbitrary timezone name that can be loaded from the database.
 .El
-.Po
-A
-.Nx
-extension.
-.Pc
 .It Cm \&%Z
 time zone name or no characters when time zone information is unavailable.
 .Po



CVS commit: src/lib/libc/time

2022-10-24 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Oct 24 23:18:31 UTC 2022

Modified Files:
src/lib/libc/time: strptime.3

Log Message:
strptime(3): make the fact that %z is an extension more prominent

Mention it near the format itself, not on the next screen (with an
awkward indentation too).


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/lib/libc/time/strptime.3

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



Re: CVS commit: src/lib/libc/time

2022-10-24 Thread Steffen Nurpmeso
Taylor R Campbell wrote in
 <20221023170035.2542f60...@jupiter.mumble.net>:
 ...
 |If you use a monotonic timer to sample the POSIX clock before and
 |after a leap second, the POSIX clock will appear to have taken twice
 |as long as it should to pass the leap second.

Just to note that the next leap second could be a negative one.

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


CVS commit: src/external/cddl/osnet/dist/cmd/zpool

2022-10-24 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 24 14:22:53 UTC 2022

Modified Files:
src/external/cddl/osnet/dist/cmd/zpool: zpool_vdev.c

Log Message:
Remove references to GEOM from zpool(8).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c

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

Modified files:

Index: src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c
diff -u src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c:1.5 src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c:1.6
--- src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c:1.5	Sun Feb 16 14:06:10 2020
+++ src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c	Mon Oct 24 14:22:53 2022
@@ -482,7 +482,7 @@ make_leaf_vdev(const char *arg, uint64_t
 			if (errno == ENOENT) {
 (void) fprintf(stderr,
 gettext("cannot open '%s': no such "
-"GEOM provider\n"), arg);
+"device\n"), arg);
 (void) fprintf(stderr,
 gettext("must be a full path or "
 "shorthand device name\n"));
@@ -513,7 +513,7 @@ make_leaf_vdev(const char *arg, uint64_t
 		type = VDEV_TYPE_FILE;
 	} else {
 		(void) fprintf(stderr, gettext("cannot use '%s': must be a "
-		"GEOM provider or regular file\n"), path);
+		"device or regular file\n"), path);
 		return (NULL);
 	}
 



CVS commit: src/external/cddl/osnet/dist/cmd/zpool

2022-10-24 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon Oct 24 14:22:53 UTC 2022

Modified Files:
src/external/cddl/osnet/dist/cmd/zpool: zpool_vdev.c

Log Message:
Remove references to GEOM from zpool(8).


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/dist/cmd/zpool/zpool_vdev.c

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



CVS commit: src/sys/netinet6

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 14:15:19 UTC 2022

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

Log Message:
Clear saved_flags to avoid compile error on some archs.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/sys/netinet6/in6.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/in6.c
diff -u src/sys/netinet6/in6.c:1.287 src/sys/netinet6/in6.c:1.288
--- src/sys/netinet6/in6.c:1.287	Mon Oct 24 01:54:19 2022
+++ src/sys/netinet6/in6.c	Mon Oct 24 14:15:19 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6.c,v 1.287 2022/10/24 01:54:19 knakahara Exp $	*/
+/*	$NetBSD: in6.c,v 1.288 2022/10/24 14:15:19 msaitoh Exp $	*/
 /*	$KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.287 2022/10/24 01:54:19 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.288 2022/10/24 14:15:19 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1067,7 +1067,7 @@ in6_update_ifa1(struct ifnet *ifp, struc
 	char ip6buf[INET6_ADDRSTRLEN];
 	bool addrmaskNotChanged = false;
 	bool send_rtm_newaddr = (ip6_param_rt_msg == 1);
-	int saved_flags;
+	int saved_flags = 0;
 
 	KASSERT((iap == NULL && psref == NULL) ||
 	(iap != NULL && psref != NULL));



CVS commit: src/sys/netinet6

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 14:15:19 UTC 2022

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

Log Message:
Clear saved_flags to avoid compile error on some archs.


To generate a diff of this commit:
cvs rdiff -u -r1.287 -r1.288 src/sys/netinet6/in6.c

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



CVS commit: src/tests/lib/libutil

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 13:42:55 UTC 2022

Modified Files:
src/tests/lib/libutil: t_sockaddr_snprintf.c

Log Message:
Sync with if_dl.h rev. 1.29's change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libutil/t_sockaddr_snprintf.c

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

Modified files:

Index: src/tests/lib/libutil/t_sockaddr_snprintf.c
diff -u src/tests/lib/libutil/t_sockaddr_snprintf.c:1.1 src/tests/lib/libutil/t_sockaddr_snprintf.c:1.2
--- src/tests/lib/libutil/t_sockaddr_snprintf.c:1.1	Fri Jul 16 13:56:32 2010
+++ src/tests/lib/libutil/t_sockaddr_snprintf.c	Mon Oct 24 13:42:55 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sockaddr_snprintf.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $ */
+/* $NetBSD: t_sockaddr_snprintf.c,v 1.2 2022/10/24 13:42:55 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2002, 2004, 2008, 2010 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 #include 
 __COPYRIGHT("@(#) Copyright (c) 2008, 2010\
  The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_sockaddr_snprintf.c,v 1.1 2010/07/16 13:56:32 jmmv Exp $");
+__RCSID("$NetBSD: t_sockaddr_snprintf.c,v 1.2 2022/10/24 13:42:55 msaitoh Exp $");
 
 #include 		/* AF_ */
 #include 			/* sun */
@@ -169,7 +169,7 @@ ATF_TC_BODY(sockaddr_snprintf_dl, tc)
 		(struct sockaddr *));
 
 	ATF_REQUIRE_EQ_MSG(i, 17, "bad length for sdl");
-	ATF_REQUIRE_STREQ(buf, "18 20 1.2.3.4.5.6");
+	ATF_REQUIRE_STREQ(buf, "18 32 1.2.3.4.5.6");
 }
 
 ATF_TP_ADD_TCS(tp)



CVS commit: src/tests/lib/libutil

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 13:42:55 UTC 2022

Modified Files:
src/tests/lib/libutil: t_sockaddr_snprintf.c

Log Message:
Sync with if_dl.h rev. 1.29's change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libutil/t_sockaddr_snprintf.c

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



Re: CVS commit: src/lib/libc/time

2022-10-24 Thread Robert Elz
Date:Sun, 23 Oct 2022 13:53:01 -0400
From:Jan Schaumann 
Message-ID:  

  | Hmm, maybe something like this?

I think there is still too much there, you don't have
to explain everything (or almost anything), but it is
in the right direction I think.

  | For example, consider a struct tm initialized with a
  | tm_year = 122, tm_mon = 11, tm_mday = 30, tm_hour =
  | 22, tm_min = 57, and a tm_sec = 0, using UTC,
  | representing 2022‐12‐31T22:57:00Z.

That last bit (the ISO format spec of the time) isn't
really needed, but doesn't hurt either - but I would avoid
an example that touches anywhere near midnight Dec 31, UTC,
(which this one does later, if not here) as that's exactly
where leap seconds start to appear, and (as illustrated in
the side-discussion in this thread) that's where things get messy.
Best to just avoid that  (Avoid June 30 for the same reason.)

  | Incrementing
  | tm_min by 13 and calling mktime() would yield a time_t
  | with value 1672528200,

That's irrelevant, the time_t returned isn't what's really
interesting here, and its binary value is way too much (useless)
information, it is the modification made to the tm that matters.
It is already clear enough in the doc (I think) that the result
from mktime() is the time_t for the normalised tm.

  | representing 2022‐12‐31T23:10:00Z,

this, or just give the adjusted tm_min and tm_hour
values, there's no need for both, and

  | as the tm_min = 70 was
  | normalized to an increment of tm_hour by one and
  | tm_min = 10.

no need for the explanation of how it was done.

  | This normalizing can lead to cascading changes: Again
  | using a struct tm initialized as in the above example
  | but with a tm_hour = 23, the same change would yield a
  | time_t with value 1672531800, representing
  | 2023‐01‐01T00:10:00Z

That's the adjustment we want to avoid, as it gets right into
what happens if we're observing leap seconds, and one was to
happen in that period.There's no need to show the year being
incremented, showing the month going up would be enough, readers
ought to be able to deduce that if the month changes from Dec to
Jan then the year would be incremented by one.

  | the normalization of tm_min incremented tm_hour,

This explanation is not needed, but if it were, that
would be correct, but

  | which lead to a normalization of tm_mday, which in
  | turn caused tm_mon to be normalized,

but not those.   Those fields (in this example) were
already within the appropriate range, they don't need
to be normalised, they're simply adjusted, or as in
this (or tm_hour above):

  | which in turn lead to the increment of tm_year.

  | In addition,

That's perhaps poor wording here, "addition" followed
immediately by "negative", it could be "Also" which
avoids this, but this lead in clause is not really
needed at all, just begin like:

  | negative values may also be normalized,
  | such that e.g., a tm_hour of −1 means 1 hour before
  | midnight, tm_mday of 0 means the day preceding the
  | current month, and tm_mon of −2 means 2 months before
  | January of tm_year.

Again, too much there, we don't need examples of everything.

I still feel though that an example with more than one adjustment
to a tm returned by localtime (though how it was originally
created is irrelevant) and which would affect Feb 29 were
it a leap year, would be worth giving (in both the leap
year and non leap year cases) so we get Feb 29 in one
case and Mar 1 in the other, from an adjustment that
affects months (and days, either directly, or as a flow on
from hours, mins, or secs) - like going back a month from
Mar 28, then forward to the next day, and sometimes still
being in Mar.

  | The fact that mktime(2) returns a time_t makes the
  | phrasing even more awkward,

Yes, as above.

  | and I suppose we could
  | leave out the actual value and say "would yield a
  | time_t representing..."?

No, nothing about the result returned at all, this should
all just be about what normalising the tm causes to happen.
Those values are not just internal, the tm passed (via ref)
is modified if needed before mktime returns.

kre



CVS commit: src/sys/dev/i2c

2022-10-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Oct 24 10:17:40 UTC 2022

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

Log Message:
iic(4): Use config_detach_children to simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/i2c/i2c.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/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.89 src/sys/dev/i2c/i2c.c:1.90
--- src/sys/dev/i2c/i2c.c:1.89	Mon Oct 24 10:17:27 2022
+++ src/sys/dev/i2c/i2c.c	Mon Oct 24 10:17:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.89 2022/10/24 10:17:27 riastradh Exp $	*/
+/*	$NetBSD: i2c.c,v 1.90 2022/10/24 10:17:40 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -53,7 +53,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.89 2022/10/24 10:17:27 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.90 2022/10/24 10:17:40 riastradh Exp $");
 
 #include 
 #include 
@@ -543,16 +543,11 @@ iic_attach(device_t parent, device_t sel
 static int
 iic_detach(device_t self, int flags)
 {
-	struct iic_softc *sc = device_private(self);
-	int i, error;
+	int error;
 
-	for (i = 0; i <= I2C_MAX_ADDR; i++) {
-		if (sc->sc_devices[i]) {
-			error = config_detach(sc->sc_devices[i], flags);
-			if (error)
-return error;
-		}
-	}
+	error = config_detach_children(self, flags);
+	if (error)
+		return error;
 
 	pmf_device_deregister(self);
 



CVS commit: src/sys/dev/i2c

2022-10-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Oct 24 10:17:40 UTC 2022

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

Log Message:
iic(4): Use config_detach_children to simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/dev/i2c/i2c.c

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



CVS commit: src/sys/dev

2022-10-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Oct 24 10:17:27 UTC 2022

Modified Files:
src/sys/dev/acpi: smbus_acpi.c
src/sys/dev/i2c: i2c.c i2c_exec.c i2cvar.h

Log Message:
i2c(9): Nix smbus intr API.

It was introduced in 2007 for some Xbox thing which was removed in
2011.  The API and the threads it spawned have been sitting around
idly for over a decade serving no purpose -- sometimes causing kernel
lock spinouts in the event of panic.

Add ic_tag_private to obviate need for future ABI changes.  Not
currently used, but we can privately allocate memory in iic_tag_init
for the purpose later if need be without changing ABI.

XXX kernel revbump -- changes struct i2c_controller


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/acpi/smbus_acpi.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/i2c/i2c_exec.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/i2c/i2cvar.h

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



CVS commit: src/sys/dev

2022-10-24 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Oct 24 10:17:27 UTC 2022

Modified Files:
src/sys/dev/acpi: smbus_acpi.c
src/sys/dev/i2c: i2c.c i2c_exec.c i2cvar.h

Log Message:
i2c(9): Nix smbus intr API.

It was introduced in 2007 for some Xbox thing which was removed in
2011.  The API and the threads it spawned have been sitting around
idly for over a decade serving no purpose -- sometimes causing kernel
lock spinouts in the event of panic.

Add ic_tag_private to obviate need for future ABI changes.  Not
currently used, but we can privately allocate memory in iic_tag_init
for the purpose later if need be without changing ABI.

XXX kernel revbump -- changes struct i2c_controller


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/acpi/smbus_acpi.c
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/i2c/i2c.c
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/i2c/i2c_exec.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/i2c/i2cvar.h

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

Modified files:

Index: src/sys/dev/acpi/smbus_acpi.c
diff -u src/sys/dev/acpi/smbus_acpi.c:1.17 src/sys/dev/acpi/smbus_acpi.c:1.18
--- src/sys/dev/acpi/smbus_acpi.c:1.17	Sat Aug  7 16:19:09 2021
+++ src/sys/dev/acpi/smbus_acpi.c	Mon Oct 24 10:17:27 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: smbus_acpi.c,v 1.17 2021/08/07 16:19:09 thorpej Exp $ */
+/* $NetBSD: smbus_acpi.c,v 1.18 2022/10/24 10:17:27 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: smbus_acpi.c,v 1.17 2021/08/07 16:19:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbus_acpi.c,v 1.18 2022/10/24 10:17:27 riastradh Exp $");
 
 #include 
 #include 
@@ -496,8 +496,6 @@ acpi_smbus_alerts(struct acpi_smbus_soft
 
 aprint_debug_dev(sc->sc_dv,
 "alert for 0x%x\n", addr);
-
-(void)iic_smbus_intr(>sc_i2c_tag);
 			}
 		}
 done:

Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.88 src/sys/dev/i2c/i2c.c:1.89
--- src/sys/dev/i2c/i2c.c:1.88	Sat Jul 23 03:05:27 2022
+++ src/sys/dev/i2c/i2c.c	Mon Oct 24 10:17:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.88 2022/07/23 03:05:27 thorpej Exp $	*/
+/*	$NetBSD: i2c.c,v 1.89 2022/10/24 10:17:27 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -53,7 +53,7 @@
 #endif /* _KERNEL_OPT */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.88 2022/07/23 03:05:27 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.89 2022/10/24 10:17:27 riastradh Exp $");
 
 #include 
 #include 
@@ -119,7 +119,6 @@ const struct cdevsw iic_cdevsw = {
 	.d_flag = D_OTHER
 };
 
-static void	iic_smbus_intr_thread(void *);
 static void	iic_fill_compat(struct i2c_attach_args*, const char*,
 			size_t, char **);
 
@@ -426,7 +425,6 @@ iic_attach(device_t parent, device_t sel
 	prop_dictionary_t props;
 	char *buf;
 	i2c_tag_t ic;
-	int rv;
 	bool no_indirect_config = false;
 
 	aprint_naive("\n");
@@ -435,16 +433,6 @@ iic_attach(device_t parent, device_t sel
 	sc->sc_dev = self;
 	sc->sc_tag = iba->iba_tag;
 	ic = sc->sc_tag;
-	ic->ic_devname = device_xname(self);
-
-	LIST_INIT(&(sc->sc_tag->ic_list));
-	LIST_INIT(&(sc->sc_tag->ic_proc_list));
-
-	rv = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN, NULL,
-	iic_smbus_intr_thread, ic, >ic_intr_thread,
-	"%s", ic->ic_devname);
-	if (rv)
-		aprint_error_dev(self, "unable to create intr thread\n");
 
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, "couldn't establish power handler\n");
@@ -556,9 +544,7 @@ static int
 iic_detach(device_t self, int flags)
 {
 	struct iic_softc *sc = device_private(self);
-	i2c_tag_t ic = sc->sc_tag;
 	int i, error;
-	void *hdl;
 
 	for (i = 0; i <= I2C_MAX_ADDR; i++) {
 		if (sc->sc_devices[i]) {
@@ -568,132 +554,12 @@ iic_detach(device_t self, int flags)
 		}
 	}
 
-	if (ic->ic_running) {
-		ic->ic_running = 0;
-		wakeup(ic);
-		kthread_join(ic->ic_intr_thread);
-	}
-
-	if (!LIST_EMPTY(>ic_list)) {
-		device_printf(self, "WARNING: intr handler list not empty\n");
-		while (!LIST_EMPTY(>ic_list)) {
-			hdl = LIST_FIRST(>ic_list);
-			iic_smbus_intr_disestablish(ic, hdl);
-		}
-	}
-	if (!LIST_EMPTY(>ic_proc_list)) {
-		device_printf(self, "WARNING: proc handler list not empty\n");
-		while (!LIST_EMPTY(>ic_proc_list)) {
-			hdl = LIST_FIRST(>ic_proc_list);
-			iic_smbus_intr_disestablish_proc(ic, hdl);
-		}
-	}
-
 	pmf_device_deregister(self);
 
 	return 0;
 }
 
 static void
-iic_smbus_intr_thread(void *aux)
-{
-	i2c_tag_t ic;
-	struct ic_intr_list *il;
-
-	ic = (i2c_tag_t)aux;
-	ic->ic_running = 1;
-	ic->ic_pending = 0;
-
-	while (ic->ic_running) {
-		if (ic->ic_pending == 0)
-			tsleep(ic, PZERO, "iicintr", hz);
-		if (ic->ic_pending > 0) {
-			LIST_FOREACH(il, &(ic->ic_proc_list), il_next) {
-(*il->il_intr)(il->il_intrarg);
-			}
-			ic->ic_pending--;
-		}
-	}
-
-	kthread_exit(0);
-}
-
-void *
-iic_smbus_intr_establish(i2c_tag_t 

CVS commit: src/sys/sys

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 08:14:11 UTC 2022

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

Log Message:
Welcome to 9.99.102

 - Increase the size of dl_data[] from 12 to 24.
 - Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.


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

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.714 src/sys/sys/param.h:1.715
--- src/sys/sys/param.h:1.714	Tue Oct 11 09:52:49 2022
+++ src/sys/sys/param.h	Mon Oct 24 08:14:11 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.714 2022/10/11 09:52:49 knakahara Exp $	*/
+/*	$NetBSD: param.h,v 1.715 2022/10/24 08:14:11 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999010100	/* NetBSD 9.99.101 */
+#define	__NetBSD_Version__	999010200	/* NetBSD 9.99.102 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/sys

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 08:14:11 UTC 2022

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

Log Message:
Welcome to 9.99.102

 - Increase the size of dl_data[] from 12 to 24.
 - Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.


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

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



CVS commit: src

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 08:11:25 UTC 2022

Modified Files:
src/sys/altq: if_altq.h
src/sys/net: if.c if.h
src/sys/net80211: ieee80211_output.c
src/usr.bin/netstat: if.c main.c

Log Message:
Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/altq/if_altq.h
cvs rdiff -u -r1.526 -r1.527 src/sys/net/if.c
cvs rdiff -u -r1.302 -r1.303 src/sys/net/if.h
cvs rdiff -u -r1.66 -r1.67 src/sys/net80211/ieee80211_output.c
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.103 -r1.104 src/usr.bin/netstat/main.c

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

Modified files:

Index: src/sys/altq/if_altq.h
diff -u src/sys/altq/if_altq.h:1.15 src/sys/altq/if_altq.h:1.16
--- src/sys/altq/if_altq.h:1.15	Wed Apr 20 08:58:48 2016
+++ src/sys/altq/if_altq.h	Mon Oct 24 08:11:24 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_altq.h,v 1.15 2016/04/20 08:58:48 knakahara Exp $	*/
+/*	$NetBSD: if_altq.h,v 1.16 2022/10/24 08:11:24 msaitoh Exp $	*/
 /*	$KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $	*/
 
 /*
@@ -44,8 +44,8 @@ struct	ifaltq {
 	struct	mbuf *ifq_tail;
 	int	ifq_len;
 	int	ifq_maxlen;
-	int	ifq_drops;
-	kmutex_t	*ifq_lock;
+	uint64_t ifq_drops;
+	kmutex_t *ifq_lock;
 
 	/* alternate queueing related fields */
 	int	altq_type;		/* discipline type */

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.526 src/sys/net/if.c:1.527
--- src/sys/net/if.c:1.526	Tue Sep 20 02:23:37 2022
+++ src/sys/net/if.c	Mon Oct 24 08:11:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.526 2022/09/20 02:23:37 knakahara Exp $	*/
+/*	$NetBSD: if.c,v 1.527 2022/10/24 08:11:25 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.526 2022/09/20 02:23:37 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.527 2022/10/24 08:11:25 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -940,7 +940,7 @@ static void
 if_percpuq_drops(void *p, void *arg, struct cpu_info *ci __unused)
 {
 	struct ifqueue *const ifq = p;
-	int *sum = arg;
+	uint64_t *sum = arg;
 
 	*sum += ifq->ifq_drops;
 }
@@ -950,7 +950,7 @@ sysctl_percpuq_drops_handler(SYSCTLFN_AR
 {
 	struct sysctlnode node;
 	struct if_percpuq *ipq;
-	int sum = 0;
+	uint64_t sum = 0;
 	int error;
 
 	node = *rnode;
@@ -1017,7 +1017,7 @@ sysctl_percpuq_setup(struct sysctllog **
 
 	if (sysctl_createv(clog, 0, , ,
 		   CTLFLAG_PERMANENT,
-		   CTLTYPE_INT, "drops",
+		   CTLTYPE_QUAD, "drops",
 		   SYSCTL_DESCR("Total packets dropped due to full input queue"),
 		   sysctl_percpuq_drops_handler, 0, (void *)ipq, 0,
 		   CTL_CREATE, CTL_EOL) != 0)
@@ -4031,7 +4031,7 @@ sysctl_sndq_setup(struct sysctllog **clo
 
 	if (sysctl_createv(clog, 0, , ,
 		   CTLFLAG_PERMANENT,
-		   CTLTYPE_INT, "drops",
+		   CTLTYPE_QUAD, "drops",
 		   SYSCTL_DESCR("Packets dropped due to full output queue"),
 		   NULL, 0, >ifq_drops, 0,
 		   CTL_CREATE, CTL_EOL) != 0)

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.302 src/sys/net/if.h:1.303
--- src/sys/net/if.h:1.302	Sun Sep 18 16:58:54 2022
+++ src/sys/net/if.h	Mon Oct 24 08:11:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.302 2022/09/18 16:58:54 martin Exp $	*/
+/*	$NetBSD: if.h,v 1.303 2022/10/24 08:11:25 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -241,7 +241,7 @@ struct ifqueue {
 	struct		mbuf *ifq_tail;
 	int		ifq_len;
 	int		ifq_maxlen;
-	int		ifq_drops;
+	uint64_t	ifq_drops;
 	kmutex_t	*ifq_lock;
 };
 

Index: src/sys/net80211/ieee80211_output.c
diff -u src/sys/net80211/ieee80211_output.c:1.66 src/sys/net80211/ieee80211_output.c:1.67
--- src/sys/net80211/ieee80211_output.c:1.66	Sat Jul 24 21:31:38 2021
+++ src/sys/net80211/ieee80211_output.c	Mon Oct 24 08:11:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ieee80211_output.c,v 1.66 2021/07/24 21:31:38 andvar Exp $	*/
+/*	$NetBSD: ieee80211_output.c,v 1.67 2022/10/24 08:11:25 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.66 2021/07/24 21:31:38 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.67 2022/10/24 08:11:25 msaitoh Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -2133,9 +2133,10 @@ ieee80211_pwrsave(struct ieee80211com *i
 		IEEE80211_NODE_SAVEQ_UNLOCK(ni);
 
 		IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY,
-			"[%s] pwr save q overflow, drops %d (size %d)\n",
-			ether_sprintf(ni->ni_macaddr), 
-			ni->ni_savedq.ifq_drops, IEEE80211_PS_MAX_QUEUE);
+		"[%s] pwr save q overflow, drops %" PRIu64
+		" (size %d)\n",
+		

CVS commit: src

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 08:11:25 UTC 2022

Modified Files:
src/sys/altq: if_altq.h
src/sys/net: if.c if.h
src/sys/net80211: ieee80211_output.c
src/usr.bin/netstat: if.c main.c

Log Message:
Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/altq/if_altq.h
cvs rdiff -u -r1.526 -r1.527 src/sys/net/if.c
cvs rdiff -u -r1.302 -r1.303 src/sys/net/if.h
cvs rdiff -u -r1.66 -r1.67 src/sys/net80211/ieee80211_output.c
cvs rdiff -u -r1.105 -r1.106 src/usr.bin/netstat/if.c
cvs rdiff -u -r1.103 -r1.104 src/usr.bin/netstat/main.c

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



CVS commit: src/sys/net

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 07:45:44 UTC 2022

Modified Files:
src/sys/net: if_dl.h

Log Message:
Increase sdl_data so that more then IFNAMSIZ bytes are available.

 - Increase the size of dl_data[] from 12 to 24.
 - Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/net/if_dl.h

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

Modified files:

Index: src/sys/net/if_dl.h
diff -u src/sys/net/if_dl.h:1.28 src/sys/net/if_dl.h:1.29
--- src/sys/net/if_dl.h:1.28	Tue Apr 30 20:55:41 2019
+++ src/sys/net/if_dl.h	Mon Oct 24 07:45:44 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_dl.h,v 1.28 2019/04/30 20:55:41 kre Exp $	*/
+/*	$NetBSD: if_dl.h,v 1.29 2022/10/24 07:45:44 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -68,11 +68,11 @@ struct dl_addr {
 	uint8_t	dl_nlen;	/* interface name length, no trailing 0 reqd. */
 	uint8_t	dl_alen;	/* link level address length */
 	uint8_t	dl_slen;	/* link layer selector length */
-	/*
-	 * minimum work area, can be larger; contains both if name
-	 * and ll address
-	 */
-	char	dl_data[12];
+	char	dl_data[24]; /*
+  * minimum work area, can be larger; contains
+  * both if name and ll address; big enough for
+  * IFNAMSIZ plus 8byte ll addr
+  */
 };
 
 /*



CVS commit: src/sys/net

2022-10-24 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Oct 24 07:45:44 UTC 2022

Modified Files:
src/sys/net: if_dl.h

Log Message:
Increase sdl_data so that more then IFNAMSIZ bytes are available.

 - Increase the size of dl_data[] from 12 to 24.
 - Same as OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/net/if_dl.h

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