git: f7d3d0a4ded3 - main - sound: use device_set_descf() to set device descriptions

2024-01-22 Thread Christos Margiolis
The branch main has been updated by christos:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f7d3d0a4ded35ba15d63cdf9287b4a2d6f80da11

commit f7d3d0a4ded35ba15d63cdf9287b4a2d6f80da11
Author: Christos Margiolis 
AuthorDate: 2024-01-22 09:44:51 +
Commit: Christos Margiolis 
CommitDate: 2024-01-22 09:44:51 +

sound: use device_set_descf() to set device descriptions

Commit 6b6914c1e21b introduced a printf-like version of
device_set_desc(), so use it to simplify device description setting in
the audio stack.

Sponsored by:   The FreeBSD Foundation
MFC after:  2 weeks
Reviewed by:dev_submerge.ch, markj
Differential Revision:  https://reviews.freebsd.org/D43467
---
 sys/dev/sound/pci/emu10kx-pcm.c |  4 +---
 sys/dev/sound/pci/emu10kx.c | 12 ++--
 sys/dev/sound/pci/hda/hdaa.c|  8 ++--
 sys/dev/sound/pci/hda/hdac.c|  6 ++
 sys/dev/sound/pci/hda/hdacc.c   |  3 +--
 sys/dev/sound/pci/hdspe-pcm.c   | 13 +
 sys/dev/sound/usb/uaudio.c  |  5 ++---
 7 files changed, 15 insertions(+), 36 deletions(-)

diff --git a/sys/dev/sound/pci/emu10kx-pcm.c b/sys/dev/sound/pci/emu10kx-pcm.c
index b4633efdddc7..825a39fc4e63 100644
--- a/sys/dev/sound/pci/emu10kx-pcm.c
+++ b/sys/dev/sound/pci/emu10kx-pcm.c
@@ -1298,7 +1298,6 @@ emu_pcm_probe(device_t dev)
 {
uintptr_t func, route;
const char *rt;
-   char buffer[255];
 
BUS_READ_IVAR(device_get_parent(dev), dev, EMU_VAR_FUNC, &func);
 
@@ -1328,8 +1327,7 @@ emu_pcm_probe(device_t dev)
break;
}
 
-   snprintf(buffer, 255, "EMU10Kx DSP %s PCM interface", rt);
-   device_set_desc_copy(dev, buffer);
+   device_set_descf(dev, "EMU10Kx DSP %s PCM interface", rt);
return (0);
 }
 
diff --git a/sys/dev/sound/pci/emu10kx.c b/sys/dev/sound/pci/emu10kx.c
index 29366c3b61f3..6bbbfcc1df0e 100644
--- a/sys/dev/sound/pci/emu10kx.c
+++ b/sys/dev/sound/pci/emu10kx.c
@@ -2985,7 +2985,6 @@ emu_write_ivar(device_t bus __unused, device_t dev 
__unused,
 static int
 emu_pci_probe(device_t dev)
 {
-   struct sbuf *s;
unsigned int thiscard = 0;
uint16_t vendor;
 
@@ -2997,15 +2996,8 @@ emu_pci_probe(device_t dev)
if (thiscard == 0)
return (ENXIO);
 
-   s = sbuf_new(NULL, NULL, 4096, 0);
-   if (s == NULL)
-   return (ENOMEM);
-   sbuf_printf(s, "Creative %s [%s]", emu_cards[thiscard].desc, 
emu_cards[thiscard].SBcode);
-   sbuf_finish(s);
-
-   device_set_desc_copy(dev, sbuf_data(s));
-
-   sbuf_delete(s);
+   device_set_descf(dev, "Creative %s [%s]",
+   emu_cards[thiscard].desc, emu_cards[thiscard].SBcode);
 
return (BUS_PROBE_DEFAULT);
 }
diff --git a/sys/dev/sound/pci/hda/hdaa.c b/sys/dev/sound/pci/hda/hdaa.c
index e64eac6114e4..02f4babcd331 100644
--- a/sys/dev/sound/pci/hda/hdaa.c
+++ b/sys/dev/sound/pci/hda/hdaa.c
@@ -6577,14 +6577,12 @@ static int
 hdaa_probe(device_t dev)
 {
const char *pdesc;
-   char buf[128];
 
if (hda_get_node_type(dev) != HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO)
return (ENXIO);
pdesc = device_get_desc(device_get_parent(dev));
-   snprintf(buf, sizeof(buf), "%.*s Audio Function Group",
+   device_set_descf(dev, "%.*s Audio Function Group",
(int)(strlen(pdesc) - 10), pdesc);
-   device_set_desc_copy(dev, buf);
return (BUS_PROBE_DEFAULT);
 }
 
@@ -6939,7 +6937,6 @@ hdaa_pcm_probe(device_t dev)
struct hdaa_devinfo *devinfo = pdevinfo->devinfo;
const char *pdesc;
char chans1[8], chans2[8];
-   char buf[128];
int loc1, loc2, t1, t2;
 
if (pdevinfo->playas >= 0)
@@ -6984,7 +6981,7 @@ hdaa_pcm_probe(device_t dev)
if (pdevinfo->digital)
t1 = -2;
pdesc = device_get_desc(device_get_parent(dev));
-   snprintf(buf, sizeof(buf), "%.*s (%s%s%s%s%s%s%s%s%s)",
+   device_set_descf(dev, "%.*s (%s%s%s%s%s%s%s%s%s)",
(int)(strlen(pdesc) - 21), pdesc,
loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "",
(pdevinfo->digital == 0x7)?"HDMI/DP":
@@ -6994,7 +6991,6 @@ hdaa_pcm_probe(device_t dev)
chans1[0] ? " " : "", chans1,
chans2[0] ? "/" : "", chans2,
t1 >= 0 ? " " : "", t1 >= 0 ? HDA_DEVS[t1] : "");
-   device_set_desc_copy(dev, buf);
return (BUS_PROBE_SPECIFIC);
 }
 
diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c
index 2cf9239499af..1f06692ba36e 100644
--- a/sys/dev/sound/pci/hda/hdac.c
+++ b/sys/dev/sound/pci/hda/hdac.c
@@ -1101,10 +1101,8 @@ hdac_probe(device_t dev)
snprintf(desc, sizeof(desc), "Generic (0x%08x)", model);
result = BUS_PROBE_GENERIC;
}
-   if (result != ENXIO) {
-   strlcat(desc, " HDA Controller", sizeof(desc));
-   device_set_desc_copy(dev, desc);
-   }
+   if (re

git: 54c62e3e5d8c - main - pf: work around icmp6 packet-too-big not being sent when binat-ing

2024-01-22 Thread Kristof Provost
The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=54c62e3e5d8cd90c5571a1d4c8c5f062d580480e

commit 54c62e3e5d8cd90c5571a1d4c8c5f062d580480e
Author: Kristof Provost 
AuthorDate: 2024-01-17 17:11:27 +
Commit: Kristof Provost 
CommitDate: 2024-01-22 11:52:14 +

pf: work around icmp6 packet-too-big not being sent when binat-ing

If we're applying NPTv6 we pass a packet with a modified source and/or
destination address to the network stack.

If that packet then turns out to be larger than the MTU of the sending
interface the stack will attempt to generate an icmp6 packet-too-big
error, but may fail to look up the appropriate source address for that
error message. Even if it does, pf would still have to undo the binat
operation inside the icmp6 packet so the sending host can make sense of
the error.

We can avoid both problems entirely by having pf also perform the MTU
check (taking the potential refragmentation into account), and
generating the icmp6 error directly in pf.

See also:   https://redmine.pfsense.org/issues/14290
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D43499
---
 sys/net/pfvar.h  |  1 +
 sys/netpfil/pf/pf.c  | 12 
 sys/netpfil/pf/pf_norm.c | 15 +++
 3 files changed, 28 insertions(+)

diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h
index f0742c99a4a8..ff3370bc105e 100644
--- a/sys/net/pfvar.h
+++ b/sys/net/pfvar.h
@@ -2297,6 +2297,7 @@ int   pf_normalize_ip6(struct mbuf **, struct 
pfi_kkif *, u_short *,
 void   pf_poolmask(struct pf_addr *, struct pf_addr*,
struct pf_addr *, struct pf_addr *, sa_family_t);
 void   pf_addr_inc(struct pf_addr *, sa_family_t);
+intpf_max_frag_size(struct mbuf *);
 intpf_refragment6(struct ifnet *, struct mbuf **, struct m_tag *, bool);
 #endif /* INET6 */
 
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 9bd9828a99d9..38a5a45d7991 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -8510,6 +8510,18 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct 
mbuf **m0, struct inpcb
return (PF_PASS);
}
 
+   /*
+* If we end up changing IP addresses (e.g. binat) the stack may get
+* confused and fail to send the icmp6 packet too big error. Just send
+* it here, before we do any NAT.
+*/
+   if (dir == PF_OUT && IN6_LINKMTU(ifp) < pf_max_frag_size(m)) {
+   PF_RULES_RUNLOCK();
+   *m0 = NULL;
+   icmp6_error(m, ICMP6_PACKET_TOO_BIG, 0, IN6_LINKMTU(ifp));
+   return (PF_DROP);
+   }
+
memset(&pd, 0, sizeof(pd));
TAILQ_INIT(&pd.sctp_multihome_jobs);
if (default_actions != NULL)
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index f5d1a66f6467..295377bef3e8 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -939,6 +939,21 @@ fail:
 #endif /* INET6 */
 
 #ifdef INET6
+int
+pf_max_frag_size(struct mbuf *m)
+{
+   struct m_tag *tag;
+   struct pf_fragment_tag *ftag;
+
+   tag = m_tag_find(m, PACKET_TAG_PF_REASSEMBLED, NULL);
+   if (tag == NULL)
+   return (m->m_pkthdr.len);
+
+   ftag = (struct pf_fragment_tag *)(tag + 1);
+
+   return (ftag->ft_maxlen);
+}
+
 int
 pf_refragment6(struct ifnet *ifp, struct mbuf **m0, struct m_tag *mtag,
 bool forward)



git: 57c50d6b3673 - main - pf tests: test ICMP6 packet too big with binat

2024-01-22 Thread Kristof Provost
The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=57c50d6b3673225064d9c38cd06a41ec1730d3d1

commit 57c50d6b3673225064d9c38cd06a41ec1730d3d1
Author: Kristof Provost 
AuthorDate: 2024-01-17 17:03:56 +
Commit: Kristof Provost 
CommitDate: 2024-01-22 12:49:56 +

pf tests: test ICMP6 packet too big with binat

Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:  https://reviews.freebsd.org/D43500
---
 tests/sys/netpfil/pf/Makefile |   1 +
 tests/sys/netpfil/pf/nat66.py | 166 ++
 2 files changed, 167 insertions(+)

diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile
index f1a2fff5a45d..30099fdc4c17 100644
--- a/tests/sys/netpfil/pf/Makefile
+++ b/tests/sys/netpfil/pf/Makefile
@@ -46,6 +46,7 @@ ATF_TESTS_SH+=altq \
tos
 
 ATF_TESTS_PYTEST+= frag6.py
+ATF_TESTS_PYTEST+= nat66.py
 ATF_TESTS_PYTEST+= sctp.py
 
 # Tests reuse jail names and so cannot run in parallel.
diff --git a/tests/sys/netpfil/pf/nat66.py b/tests/sys/netpfil/pf/nat66.py
new file mode 100644
index ..006ab5afee7f
--- /dev/null
+++ b/tests/sys/netpfil/pf/nat66.py
@@ -0,0 +1,166 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2024 Rubicon Communications, LLC (Netgate)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+
+import ctypes
+import ipaddress
+import pytest
+import re
+import socket
+import threading
+import time
+from atf_python.sys.net.tools import ToolsHelper
+from atf_python.sys.net.vnet import VnetTestTemplate
+
+class DelayedSend(threading.Thread):
+def __init__(self, packet):
+threading.Thread.__init__(self)
+self._packet = packet
+
+self.start()
+
+def run(self):
+import scapy.all as sp
+time.sleep(1)
+sp.send(self._packet)
+
+class TestNAT66(VnetTestTemplate):
+REQUIRED_MODUES = [ "pf" ]
+TOPOLOGY = {
+"vnet1": {"ifaces": ["if1"]},
+"vnet2": {"ifaces": ["if1", "if2"]},
+"vnet3": {"ifaces": ["if2"]},
+"if1": {"prefixes6": [("2001:db8::2/64", "2001:db8::1/64")]},
+"if2": {"prefixes6": [("2001:db8:1::1/64", "2001:db8:1::2/64")]},
+}
+
+def vnet2_handler(self, vnet):
+ifname = vnet.iface_alias_map["if1"].name
+ToolsHelper.print_output("/sbin/ifconfig %s mtu 9000" % ifname)
+
+ToolsHelper.print_output("/sbin/pfctl -e")
+ToolsHelper.pf_rules([
+"set reassemble yes",
+"binat inet6 from 2001:db8::/64 to 2001:db8:1::/64 -> 
2001:db8:42::/64",
+"binat inet6 from 2001:db8:1::/64 to 2001:db8:42::/64 -> 
2001:db8::/64",
+"pass inet6 proto icmp6"])
+
+ToolsHelper.print_output("/sbin/sysctl net.inet6.ip6.forwarding=1")
+
+def vnet3_handler(self, vnet):
+ToolsHelper.print_output("/sbin/route add -6 2001:db8:42::/64 
2001:db8:1::1")
+
+def check_icmp_too_big(self, sp, payload_size, frag_size=None):
+packet = sp.IPv6(src="2001:db8::2", dst="2001:db8:1::2") \
+/ sp.ICMPv6EchoRequest(data=sp.raw(bytes.fromhex('f0') * 
payload_size))
+
+if frag_size is not None:
+packet = sp.fragment6(packet, frag_size)
+
+# Delay the send so the sniffer is running when we transmit.
+s = DelayedSend(packet)
+
+packets = sp.sniff(iface=self.vnet.iface_alias_map["if1"].name,
+timeout=3)
+found=False
+for p in packets:
+# We can't get a reply to this
+assert not p.getlayer(sp.ICMPv6EchoReply)
+
+if not p.getlayer(sp.ICMPv6PacketTooBig):
+continue
+
+ip6 = p.getlayer(sp.IPv6

Re: git: 636592343c3e - main - tmpfs: increase memory reserve to a percent of available memory + swap

2024-01-22 Thread Mike Karels
On 21 Jan 2024, at 21:48, Alexey Dokuchaev wrote:

> On Mon, Jan 22, 2024 at 03:27:57AM +, Jessica Clarke wrote:
>> On 19 Dec 2023, at 15:34, Mike Karels  wrote:
>>> commit 636592343c3ec0feb61a4d8043676381384420dd
>>>
>>>tmpfs: increase memory reserve to a percent of available memory + swap
>>>
>>>[...]
>>>
>>>Add sysctl for vfs.tmpfs.memory_percent and the pre-existing
>>>vfs.tmpfs.memory_reserved to tmpfs(5).
>>>
>>>PR: 275436
>>>MFC after:  1 month
>>>Reviewed by:rgrimes
>>>Differential Revision:  https://reviews.freebsd.org/D43011
>>
>> I just got:
>>
>>   make[6]: Could not create temporary file /tmp/makeDl4i9S:
>>   No space left on device
>>
>> after doing a buildworld -j4 on a 4 core, 16 GiB system where /tmp is a
>> tmpfs, with the prior buildworld having taken me past this commit,
>> which I strongly suspect to be the cause. Whilst I understand the
>> motivation behind your commits, this is a sad regression to have; it's
>> not exactly a particularly strange situation.

Bug 276402 is about the interaction of this change with ZFS ARC, which
seems to be problematical.  I spent some time investigating yesterday.
Depending on the dynamics, I get different results.  If tmpfs grows,
the ARC will be reduced if needed.  But if the ARC grows to the point
that tmpfs sets free space to 0 or quite low, attempts to write to
tmpfs fail without any reduction in ARC.

Jess, two quesions:

1. Are you using ZFS on this system?

2. Can you try with vfs.tmpfs.memory_percent set to 100?

> FWIW, I've seen two people complain about this last week, apparently
> this kernel OOM protection doesn't work very well. :-/

So far, I have only seen OOM kills when memory + swap are quite short,
with a tmpfs memory_percent above 95.  But with ZFS, it can happen
when the ARC could have been reduced.

I will investigate more today.  If I don't find a way to resolve this,
I'll probably commit a change to set vfs.tmpfs.memory_percent to 100
by default, at least for now, and if that works around the problem.

Mike



Re: Re: git: 636592343c3e - main - tmpfs: increase memory reserve to a percent of available memory + swap

2024-01-22 Thread Baptiste Daroussin
On Mon, Jan 22, 2024 at 07:15:22AM -0600, Mike Karels wrote:
> On 21 Jan 2024, at 21:48, Alexey Dokuchaev wrote:
> 
> > On Mon, Jan 22, 2024 at 03:27:57AM +, Jessica Clarke wrote:
> >> On 19 Dec 2023, at 15:34, Mike Karels  wrote:
> >>> commit 636592343c3ec0feb61a4d8043676381384420dd
> >>>
> >>>tmpfs: increase memory reserve to a percent of available memory + swap
> >>>
> >>>[...]
> >>>
> >>>Add sysctl for vfs.tmpfs.memory_percent and the pre-existing
> >>>vfs.tmpfs.memory_reserved to tmpfs(5).
> >>>
> >>>PR: 275436
> >>>MFC after:  1 month
> >>>Reviewed by:rgrimes
> >>>Differential Revision:  https://reviews.freebsd.org/D43011
> >>
> >> I just got:
> >>
> >>   make[6]: Could not create temporary file /tmp/makeDl4i9S:
> >>   No space left on device
> >>
> >> after doing a buildworld -j4 on a 4 core, 16 GiB system where /tmp is a
> >> tmpfs, with the prior buildworld having taken me past this commit,
> >> which I strongly suspect to be the cause. Whilst I understand the
> >> motivation behind your commits, this is a sad regression to have; it's
> >> not exactly a particularly strange situation.
> 
> Bug 276402 is about the interaction of this change with ZFS ARC, which
> seems to be problematical.  I spent some time investigating yesterday.
> Depending on the dynamics, I get different results.  If tmpfs grows,
> the ARC will be reduced if needed.  But if the ARC grows to the point
> that tmpfs sets free space to 0 or quite low, attempts to write to
> tmpfs fail without any reduction in ARC.
> 
> Jess, two quesions:
> 
> 1. Are you using ZFS on this system?
> 
> 2. Can you try with vfs.tmpfs.memory_percent set to 100?
> 
> > FWIW, I've seen two people complain about this last week, apparently
> > this kernel OOM protection doesn't work very well. :-/
> 
> So far, I have only seen OOM kills when memory + swap are quite short,
> with a tmpfs memory_percent above 95.  But with ZFS, it can happen
> when the ARC could have been reduced.
> 
> I will investigate more today.  If I don't find a way to resolve this,
> I'll probably commit a change to set vfs.tmpfs.memory_percent to 100
> by default, at least for now, and if that works around the problem.
> 
This is easily reproducible with poudriere, if you try to build some
ports/packages which are big memory consumers, for example any chrome variant or
just lang/rust, I have a machine with 64G of ram and it is impossible to get
lang/rust build in poudriere (USE_TMPFS=all) without setting
vfs.tmpfs.memory_percent to 100.

the poudriere dies with plenty of no space left on device.

Best regards,
Bapt



git: c19fb1f963e3 - main - sqlite3: Vendor import of sqlite3 3.45.0

2024-01-22 Thread Cy Schubert
The branch main has been updated by cy:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c19fb1f963e3dc88a82b20d1b17f94a4cd321e74

commit c19fb1f963e3dc88a82b20d1b17f94a4cd321e74
Merge: 57c50d6b3673 cdad538768db
Author: Cy Schubert 
AuthorDate: 2024-01-22 15:35:06 +
Commit: Cy Schubert 
CommitDate: 2024-01-22 15:35:06 +

sqlite3: Vendor import of sqlite3 3.45.0

Release notes at https://www.sqlite.org/releaselog/3_45_0.html

Obtained from:  https://www.sqlite.org/2024/sqlite-autoconf-345.tar.gz

MFC after:  2 weeks
Merge commit 'cdad538768db9e2c8258d19e9282fb5aaae80e46'

 contrib/sqlite3/Makefile.msc |1 +
 contrib/sqlite3/configure|   20 +-
 contrib/sqlite3/configure.ac |2 +-
 contrib/sqlite3/shell.c  | 3183 +--
 contrib/sqlite3/sqlite3.c| 8087 ++
 contrib/sqlite3/sqlite3.h|  152 +-
 contrib/sqlite3/sqlite3rc.h  |2 +-
 contrib/sqlite3/tea/configure|   18 +-
 contrib/sqlite3/tea/configure.ac |2 +-
 9 files changed, 7698 insertions(+), 3769 deletions(-)




git: 43be2d7aaf25 - main - wg: detach bpf upon destroy as well

2024-01-22 Thread Kyle Evans
The branch main has been updated by kevans:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=43be2d7aaf25b719aec8f49aab110c0061f1edec

commit 43be2d7aaf25b719aec8f49aab110c0061f1edec
Author: Aaron LI 
AuthorDate: 2024-01-22 16:18:56 +
Commit: Kyle Evans 
CommitDate: 2024-01-22 16:22:44 +

wg: detach bpf upon destroy as well

bpfattach() is called in wg_clone_create(), but the bpfdetach() is
missing from wg_close_destroy().  Add the missing bpfdetach() to avoid
leaking both the associated bpf bits as well as the ifnet that bpf will
hold a reference to.

PR: 276526
MFC after:  3 days
---
 sys/dev/wg/if_wg.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c
index 58c0e2db1ee8..c7649e2b4059 100644
--- a/sys/dev/wg/if_wg.c
+++ b/sys/dev/wg/if_wg.c
@@ -2876,6 +2876,7 @@ wg_clone_destroy(struct if_clone *ifc, if_t ifp, uint32_t 
flags)
 
if (cred != NULL)
crfree(cred);
+   bpfdetach(sc->sc_ifp);
if_detach(sc->sc_ifp);
if_free(sc->sc_ifp);
 



git: 8297ff13fb60 - main - tcp_wrappers: silence a few warnings

2024-01-22 Thread Piotr Pawel Stefaniak
The branch main has been updated by pstef:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=8297ff13fb604c86797e6a66bc654caff2cf3ce2

commit 8297ff13fb604c86797e6a66bc654caff2cf3ce2
Author: Piotr Paweł Stefaniak 
AuthorDate: 2024-01-21 10:15:48 +
Commit: Piotr Paweł Stefaniak 
CommitDate: 2024-01-22 16:23:49 +

tcp_wrappers: silence a few warnings

Mostly -Wdeprecated-non-prototype.

Reviewed by:emaste
Differential Revision:  https://reviews.freebsd.org/D43531
---
 contrib/tcp_wrappers/options.c | 38 --
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/contrib/tcp_wrappers/options.c b/contrib/tcp_wrappers/options.c
index 481ba2d372d5..26e98db8ed95 100644
--- a/contrib/tcp_wrappers/options.c
+++ b/contrib/tcp_wrappers/options.c
@@ -76,20 +76,20 @@ static char *chop_string(char *string); /* 
strip leading and trailing blanks */
 
 /* List of functions that implement the options. Add yours here. */
 
-static void user_option(); /* execute "user name.group" option */
-static void group_option();/* execute "group name" option */
-static void umask_option();/* execute "umask mask" option */
-static void linger_option();   /* execute "linger time" option */
-static void keepalive_option();/* execute "keepalive" option */
-static void spawn_option();/* execute "spawn command" option */
-static void twist_option();/* execute "twist command" option */
-static void rfc931_option();   /* execute "rfc931" option */
-static void setenv_option();   /* execute "setenv name value" */
-static void nice_option(); /* execute "nice" option */
-static void severity_option(); /* execute "severity value" */
-static void allow_option();/* execute "allow" option */
-static void deny_option(); /* execute "deny" option */
-static void banners_option();  /* execute "banners path" option */
+static void user_option(char *, struct request_info *);/* user 
name.group */
+static void group_option(char *, struct request_info *);   /* group name */
+static void umask_option(char *, struct request_info *);   /* umask mask */
+static void linger_option(char *, struct request_info *);  /* linger time 
*/
+static void keepalive_option(char *, struct request_info *);   /* keepalive */
+static void spawn_option(char *, struct request_info *);   /* spawn 
command */
+static void twist_option(char *, struct request_info *);   /* twist 
command */
+static void rfc931_option(char *, struct request_info *);  /* rfc931 */
+static void setenv_option(char *, struct request_info *);  /* setenv name 
value */
+static void nice_option(char *, struct request_info *);/* nice 
*/
+static void severity_option(char *, struct request_info *);/* severity 
value */
+static void allow_option(char *, struct request_info *);   /* allow */
+static void deny_option(char *, struct request_info *);/* deny 
*/
+static void banners_option(char *, struct request_info *); /* banners path 
*/
 
 /* Structure of the options table. */
 
@@ -197,9 +197,7 @@ voidprocess_options(char *options, struct request_info 
*request)
 
 /* ARGSUSED */
 
-static void allow_option(value, request)
-char   *value;
-struct request_info *request;
+static void allow_option(char *value, struct request_info *request)
 {
 longjmp(tcpd_buf, AC_PERMIT);
 }
@@ -208,9 +206,7 @@ struct request_info *request;
 
 /* ARGSUSED */
 
-static void deny_option(value, request)
-char   *value;
-struct request_info *request;
+static void deny_option(char *value, struct request_info *request)
 {
 longjmp(tcpd_buf, AC_DENY);
 }
@@ -250,7 +246,6 @@ static void banners_option(char *value, struct request_info 
*request)
 static void group_option(char *value, struct request_info *request)
 {
 struct group *grp;
-struct group *getgrnam();
 
 if ((grp = getgrnam(value)) == 0)
tcpd_jump("unknown group: \"%s\"", value);
@@ -267,7 +262,6 @@ static void group_option(char *value, struct request_info 
*request)
 static void user_option(char *value, struct request_info *request)
 {
 struct passwd *pwd;
-struct passwd *getpwnam();
 char   *group;
 
 if ((group = split_at(value, '.')) != 0)



git: 484e977f2441 - main - pflow: observation domain is an unsigned integer

2024-01-22 Thread Kristof Provost
The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=484e977f24418afa848d7ea1531b4379446d6065

commit 484e977f24418afa848d7ea1531b4379446d6065
Author: Kristof Provost 
AuthorDate: 2024-01-22 16:34:44 +
Commit: Kristof Provost 
CommitDate: 2024-01-22 17:02:10 +

pflow: observation domain is an unsigned integer

Ensure we print it as such, rather than as a signed integer, as that
would lead to confusion.

Reported by:Jim Pingle 
Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sbin/pflowctl/pflowctl.c  |  2 +-
 tests/sys/netpfil/pf/pflow.sh | 25 +
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/sbin/pflowctl/pflowctl.c b/sbin/pflowctl/pflowctl.c
index 35daedfdf478..4186598dd9bc 100644
--- a/sbin/pflowctl/pflowctl.c
+++ b/sbin/pflowctl/pflowctl.c
@@ -340,7 +340,7 @@ get(int id)
if (! snl_parse_nlmsg(&ss, hdr, &get_parser, &g))
continue;
 
-   printf("pflow%d: version %d domain %d", g.id, g.version, 
g.obs_dom);
+   printf("pflow%d: version %d domain %u", g.id, g.version, 
g.obs_dom);
print_sockaddr(" src ", &g.src.storage);
print_sockaddr(" dst ", &g.dst.storage);
printf("\n");
diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh
index 3cef5f5a2d98..10efcbb93ac4 100644
--- a/tests/sys/netpfil/pf/pflow.sh
+++ b/tests/sys/netpfil/pf/pflow.sh
@@ -282,6 +282,30 @@ rule_cleanup()
pft_cleanup
 }
 
+atf_test_case "obs_dom" "cleanup"
+obs_dom_head()
+{
+   atf_set descr 'Test configuring observation domain values'
+   atf_set require.user root
+}
+
+obs_dom_body()
+{
+   pflow_init
+
+   vnet_mkjail alcatraz
+
+   pflow=$(jexec alcatraz pflowctl -c)
+   jexec alcatraz pflowctl -s ${pflow} domain 23
+   atf_check -o match:".*domain 23.*" -s exit:0 \
+   jexec alcatraz pflowctl -l
+}
+
+obs_dom_cleanup()
+{
+   pft_cleanup
+}
+
 atf_init_test_cases()
 {
atf_add_test_case "basic"
@@ -289,4 +313,5 @@ atf_init_test_cases()
atf_add_test_case "v6"
atf_add_test_case "nat"
atf_add_test_case "rule"
+   atf_add_test_case "obs_dom"
 }



git: 63a5fe834354 - main - pflow: limit to no more than 128 flow exporters

2024-01-22 Thread Kristof Provost
The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=63a5fe834354dc9249388e0805e6ea68dc9f02c7

commit 63a5fe834354dc9249388e0805e6ea68dc9f02c7
Author: Kristof Provost 
AuthorDate: 2024-01-22 16:35:54 +
Commit: Kristof Provost 
CommitDate: 2024-01-22 17:02:10 +

pflow: limit to no more than 128 flow exporters

While there are no inherent limits to the number of exporters we're
likely to scale rather badly to very large numbers. There's also no
obvious use case for more than a handful. Limit to 128 exporters to
prevent foot-shooting.

Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/net/pflow.h   |  2 ++
 sys/netpfil/pf/pflow.c|  6 +-
 tests/sys/netpfil/pf/pflow.sh | 32 
 3 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/sys/net/pflow.h b/sys/net/pflow.h
index 456e3de52ab1..4c194e14e001 100644
--- a/sys/net/pflow.h
+++ b/sys/net/pflow.h
@@ -39,6 +39,8 @@
 #include 
 #endif
 
+#define PFLOW_MAX_ENTRIES  128
+
 #define PFLOW_ID_LEN   sizeof(u_int64_t)
 
 #define PFLOW_MAXFLOWS 30
diff --git a/sys/netpfil/pf/pflow.c b/sys/netpfil/pf/pflow.c
index aa05ee0d..17a68e0d9e57 100644
--- a/sys/netpfil/pf/pflow.c
+++ b/sys/netpfil/pf/pflow.c
@@ -176,7 +176,7 @@ vnet_pflowattach(void)
CK_LIST_INIT(&V_pflowif_list);
mtx_init(&V_pflowif_list_mtx, "pflow interface list mtx", NULL, 
MTX_DEF);
 
-   V_pflow_unr = new_unrhdr(0, INT_MAX, &V_pflowif_list_mtx);
+   V_pflow_unr = new_unrhdr(0, PFLOW_MAX_ENTRIES - 1, &V_pflowif_list_mtx);
 
for (int i = 0; i < pflow_ncounters; i++)
V_pflowstats.c[i] = counter_u64_alloc(M_WAITOK);
@@ -1343,6 +1343,10 @@ pflow_nl_create(struct nlmsghdr *hdr, struct nl_pstate 
*npt)
ghdr_new->reserved = 0;
 
unit = alloc_unr(V_pflow_unr);
+   if (unit == -1) {
+   nlmsg_abort(nw);
+   return (ENOMEM);
+   }
 
error = pflow_create(unit);
if (error != 0) {
diff --git a/tests/sys/netpfil/pf/pflow.sh b/tests/sys/netpfil/pf/pflow.sh
index 10efcbb93ac4..f0552eb061da 100644
--- a/tests/sys/netpfil/pf/pflow.sh
+++ b/tests/sys/netpfil/pf/pflow.sh
@@ -282,6 +282,37 @@ rule_cleanup()
pft_cleanup
 }
 
+atf_test_case "max_entries" "cleanup"
+max_entries_head()
+{
+   atf_set descr 'Test that we can only create X pflow senders'
+   atf_set require.user root
+}
+
+max_entries_body()
+{
+   pflow_init
+
+   vnet_mkjail alcatraz
+
+   for i in `seq 1 128`
+   do
+   atf_check -s exit:0 -o ignore \
+   jexec alcatraz pflowctl -c
+   done
+
+   # We cannot create the 129th pflow sender
+   atf_check -s exit:1 -o ignore -e ignore \
+   jexec alcatraz pflowctl -c
+
+   jexec alcatraz pflowctl -l
+}
+
+max_entries_cleanup()
+{
+   pft_cleanup
+}
+
 atf_test_case "obs_dom" "cleanup"
 obs_dom_head()
 {
@@ -313,5 +344,6 @@ atf_init_test_cases()
atf_add_test_case "v6"
atf_add_test_case "nat"
atf_add_test_case "rule"
+   atf_add_test_case "max_entries"
atf_add_test_case "obs_dom"
 }



Re: git: 636592343c3e - main - tmpfs: increase memory reserve to a percent of available memory + swap

2024-01-22 Thread Mark Millard
Baptiste Daroussin  wrote on
Date: Mon, 22 Jan 2024 13:23:37 UTC :

> On Mon, Jan 22, 2024 at 07:15:22AM -0600, Mike Karels wrote:
> > On 21 Jan 2024, at 21:48, Alexey Dokuchaev wrote:
> > 
> > > On Mon, Jan 22, 2024 at 03:27:57AM +, Jessica Clarke wrote:
> > >> On 19 Dec 2023, at 15:34, Mike Karels  wrote:
> > >>> commit 636592343c3ec0feb61a4d8043676381384420dd
> > >>>
> > >>> tmpfs: increase memory reserve to a percent of available memory + swap
> > >>>
> > >>> [...]
> > >>>
> > >>> Add sysctl for vfs.tmpfs.memory_percent and the pre-existing
> > >>> vfs.tmpfs.memory_reserved to tmpfs(5).
> > >>>
> > >>> PR: 275436
> > >>> MFC after: 1 month
> > >>> Reviewed by: rgrimes
> > >>> Differential Revision: https://reviews.freebsd.org/D43011
> > >>
> > >> I just got:
> > >>
> > >> make[6]: Could not create temporary file /tmp/makeDl4i9S:
> > >> No space left on device
> > >>
> > >> after doing a buildworld -j4 on a 4 core, 16 GiB system where /tmp is a
> > >> tmpfs, with the prior buildworld having taken me past this commit,
> > >> which I strongly suspect to be the cause. Whilst I understand the
> > >> motivation behind your commits, this is a sad regression to have; it's
> > >> not exactly a particularly strange situation.
> > 
> > Bug 276402 is about the interaction of this change with ZFS ARC, which
> > seems to be problematical. I spent some time investigating yesterday.
> > Depending on the dynamics, I get different results. If tmpfs grows,
> > the ARC will be reduced if needed. But if the ARC grows to the point
> > that tmpfs sets free space to 0 or quite low, attempts to write to
> > tmpfs fail without any reduction in ARC.
> > 
> > Jess, two quesions:
> > 
> > 1. Are you using ZFS on this system?
> > 
> > 2. Can you try with vfs.tmpfs.memory_percent set to 100?
> > 
> > > FWIW, I've seen two people complain about this last week, apparently
> > > this kernel OOM protection doesn't work very well. :-/
> > 
> > So far, I have only seen OOM kills when memory + swap are quite short,
> > with a tmpfs memory_percent above 95. But with ZFS, it can happen
> > when the ARC could have been reduced.
> > 
> > I will investigate more today. If I don't find a way to resolve this,
> > I'll probably commit a change to set vfs.tmpfs.memory_percent to 100
> > by default, at least for now, and if that works around the problem.
> > 
> This is easily reproducible with poudriere, if you try to build some
> ports/packages which are big memory consumers, for example any chrome variant 
> or
> just lang/rust, I have a machine with 64G of ram

How many hardware threads?
How much swap space?
You specified: USE_TMPFS=all
ALLOW_MAKE_JOBS=yes ?
MAKE_JOBS_NUMBER use (or the like)?
I assume ZFS but any ARC specific tuning?

Not that you would want to do what I do, but it
illustrates why I ask about the contexts explored.


16 hardware thread aarch64 with 64 GiBytes of RAM context:

I've historically used:
ZFS untuned ARC context (but I also do the same in UFS contexts)
USE_TMPFS=all
ALLOW_MAKE_JOBS=yes
no MAKE_JOBS_NUMBER other than for editors/lapce*
RAM+SWAP == 310 GiBytes (so a little over RAM+SWAP==4.8*RAM)

Basically SWAP is preventing tmpfs use from running
out of space, despite the likes of 25 GiByte+ use
of tmpfs by the rust build, for example.

Historically multiple toolchains building in parallel
in the resulting high load average context have
completed just fine, including when rust is one of
them. I've not come close to running out of RAM+SWAP
so far.

Although my testing of "bulk -a" is very rare, such
has worked when I tried it, also using the hig load
average style.

Why ~4.8? Because somewhere between there and 5.0 the
binding of the swap space starts puttting out a notice
about potentially being mistuned. (It reports on a
potential change that I do not know the other tradeoffs
for. So I stay in the range where no notice is made.)

> and it is impossible to get
> lang/rust build in poudriere (USE_TMPFS=all) without setting
> vfs.tmpfs.memory_percent to 100.

I'm guessing this is implicitly: without having a huge
RAM+SWAP space.

> the poudriere dies with plenty of no space left on device.

I will note that I've not tested my configuration
with the change yet, holding back on updating FreeBSD
for other reasons. But I doubt that I'd run out of
RAM+SWAP, given the huge RAM+SWAP that I've
historically used for the context.

I do analogously on 2 other systems:
32  GiBytes of RAM and  8 hardware threads
192 GiBytes of RAM and 32 hardware threads
(Both having both ZFS and UFS media.)

On the various small RAM systems, I use
USE_TMPFS=data or USE_TMPFS=no and avoid
ZFS.

I also always avoid spinning rust.


===
Mark Millard
marklmi at yahoo.com




Re: git: 636592343c3e - main - tmpfs: increase memory reserve to a percent of available memory + swap

2024-01-22 Thread Mark Millard
On Jan 22, 2024, at 11:37, Mark Millard  wrote:
> 
> Baptiste Daroussin  wrote on
> Date: Mon, 22 Jan 2024 13:23:37 UTC :
> 
>> On Mon, Jan 22, 2024 at 07:15:22AM -0600, Mike Karels wrote:
>>> On 21 Jan 2024, at 21:48, Alexey Dokuchaev wrote:
>>> 
 On Mon, Jan 22, 2024 at 03:27:57AM +, Jessica Clarke wrote:
> On 19 Dec 2023, at 15:34, Mike Karels  wrote:
>> commit 636592343c3ec0feb61a4d8043676381384420dd
>> 
>> tmpfs: increase memory reserve to a percent of available memory + swap
>> 
>> [...]
>> 
>> Add sysctl for vfs.tmpfs.memory_percent and the pre-existing
>> vfs.tmpfs.memory_reserved to tmpfs(5).
>> 
>> PR: 275436
>> MFC after: 1 month
>> Reviewed by: rgrimes
>> Differential Revision: https://reviews.freebsd.org/D43011
> 
> I just got:
> 
> make[6]: Could not create temporary file /tmp/makeDl4i9S:
> No space left on device
> 
> after doing a buildworld -j4 on a 4 core, 16 GiB system where /tmp is a
> tmpfs, with the prior buildworld having taken me past this commit,
> which I strongly suspect to be the cause. Whilst I understand the
> motivation behind your commits, this is a sad regression to have; it's
> not exactly a particularly strange situation.
>>> 
>>> Bug 276402 is about the interaction of this change with ZFS ARC, which
>>> seems to be problematical. I spent some time investigating yesterday.
>>> Depending on the dynamics, I get different results. If tmpfs grows,
>>> the ARC will be reduced if needed. But if the ARC grows to the point
>>> that tmpfs sets free space to 0 or quite low, attempts to write to
>>> tmpfs fail without any reduction in ARC.
>>> 
>>> Jess, two quesions:
>>> 
>>> 1. Are you using ZFS on this system?
>>> 
>>> 2. Can you try with vfs.tmpfs.memory_percent set to 100?
>>> 
 FWIW, I've seen two people complain about this last week, apparently
 this kernel OOM protection doesn't work very well. :-/
>>> 
>>> So far, I have only seen OOM kills when memory + swap are quite short,
>>> with a tmpfs memory_percent above 95. But with ZFS, it can happen
>>> when the ARC could have been reduced.
>>> 
>>> I will investigate more today. If I don't find a way to resolve this,
>>> I'll probably commit a change to set vfs.tmpfs.memory_percent to 100
>>> by default, at least for now, and if that works around the problem.
>>> 
>> This is easily reproducible with poudriere, if you try to build some
>> ports/packages which are big memory consumers, for example any chrome 
>> variant or
>> just lang/rust, I have a machine with 64G of ram
> 
> How many hardware threads?
> How much swap space?

For got to ask: How many parallel builders allowed
in the bulk run at once?

> You specified: USE_TMPFS=all
> ALLOW_MAKE_JOBS=yes ?
> MAKE_JOBS_NUMBER use (or the like)?
> I assume ZFS but any ARC specific tuning?
> 
> Not that you would want to do what I do, but it
> illustrates why I ask about the contexts explored.
> 
> 
> 16 hardware thread aarch64 with 64 GiBytes of RAM context:
> 
> I've historically used:

Forgot to say:

Number of parallel builders allowed in the bulk run
equal to the count of hardware threads, so 16 here.

> ZFS untuned ARC context (but I also do the same in UFS contexts)
> USE_TMPFS=all
> ALLOW_MAKE_JOBS=yes
> no MAKE_JOBS_NUMBER other than for editors/lapce*
> RAM+SWAP == 310 GiBytes (so a little over RAM+SWAP==4.8*RAM)
> 
> Basically SWAP is preventing tmpfs use from running
> out of space, despite the likes of 25 GiByte+ use
> of tmpfs by the rust build, for example.
> 
> Historically multiple toolchains building in parallel
> in the resulting high load average context have
> completed just fine, including when rust is one of
> them. I've not come close to running out of RAM+SWAP
> so far.
> 
> Although my testing of "bulk -a" is very rare, such
> has worked when I tried it, also using the hig load
> average style.
> 
> Why ~4.8? Because somewhere between there and 5.0 the
> binding of the swap space starts puttting out a notice
> about potentially being mistuned. (It reports on a
> potential change that I do not know the other tradeoffs
> for. So I stay in the range where no notice is made.)
> 
>> and it is impossible to get
>> lang/rust build in poudriere (USE_TMPFS=all) without setting
>> vfs.tmpfs.memory_percent to 100.
> 
> I'm guessing this is implicitly: without having a huge
> RAM+SWAP space.
> 
>> the poudriere dies with plenty of no space left on device.
> 
> I will note that I've not tested my configuration
> with the change yet, holding back on updating FreeBSD
> for other reasons. But I doubt that I'd run out of
> RAM+SWAP, given the huge RAM+SWAP that I've
> historically used for the context.
> 
> I do analogously on 2 other systems:
> 32  GiBytes of RAM and  8 hardware threads
> 192 GiBytes of RAM and 32 hardware threads
> (Both having both ZFS and UFS media.)
> 
> On the various small RAM systems, I use
> USE_TMPFS=data or USE_TMPFS=no and avoid

git: 7f3184ba7974 - main - tcp: remove outdated comment

2024-01-22 Thread Gleb Smirnoff
The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=7f3184ba797452703904d33377dada5f0f8eae96

commit 7f3184ba797452703904d33377dada5f0f8eae96
Author: Gleb Smirnoff 
AuthorDate: 2024-01-22 20:42:21 +
Commit: Gleb Smirnoff 
CommitDate: 2024-01-22 20:42:21 +

tcp: remove outdated comment

This paragraph should have been removed in 446ccdd08e2a.
---
 sys/netinet/tcp_var.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 5f064ead7f64..f9b3d1a5c3ee 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -535,16 +535,6 @@ typedef enum {
 #defineTCP_FUNC_OUTPUT_CANDROP 0x02/* tfb_tcp_output may ask 
tcp_drop */
 
 /**
- * If defining the optional tcp_timers, in the
- * tfb_tcp_timer_stop call you must use the
- * callout_async_drain() function with the
- * tcp_timer_discard callback. You should check
- * the return of callout_async_drain() and if 0
- * increment tt_draincnt. Since the timer sub-system
- * does not know your callbacks you must provide a
- * stop_all function that loops through and calls
- * tcp_timer_stop() with each of your defined timers.
- *
  * Adding a tfb_tcp_handoff_ok function allows the socket
  * option to change stacks to query you even if the
  * connection is in a later stage. You return 0 to



git: d04df664776b - main - bootpd(8): Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d04df664776b436f712051520d48f84be93ab269

commit d04df664776b436f712051520d48f84be93ab269
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:46:31 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:46:31 +

bootpd(8): Fix a typo in a source code comment

- s/adddress/address/

MFC after:  3 days
---
 libexec/bootpd/dumptab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libexec/bootpd/dumptab.c b/libexec/bootpd/dumptab.c
index 3961cb4210cb..9b839c26c5b9 100644
--- a/libexec/bootpd/dumptab.c
+++ b/libexec/bootpd/dumptab.c
@@ -323,7 +323,7 @@ dump_generic(FILE *fp, struct shared_bindata *generic)
  *
  * The addresses are printed in standard ASCII "dot" notation and separated
  * from one another by a single space.  A single leading space is also
- * printed before the first adddress.
+ * printed before the first address.
  *
  * Null lists produce no output (and no error).
  */



git: b971c51a4d94 - main - aic7xxx: Fix two typos in source code comments

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b971c51a4d9498c26079fd8229f7af6ef1585020

commit b971c51a4d9498c26079fd8229f7af6ef1585020
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:47:23 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:47:23 +

aic7xxx: Fix two typos in source code comments

- s/recevied/received/

MFC after:  3 days
---
 sys/dev/aic7xxx/aic79xx.seq | 2 +-
 sys/dev/aic7xxx/aic7xxx.seq | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/aic7xxx/aic79xx.seq b/sys/dev/aic7xxx/aic79xx.seq
index 118c4f187486..85957102eb5e 100644
--- a/sys/dev/aic7xxx/aic79xx.seq
+++ b/sys/dev/aic7xxx/aic79xx.seq
@@ -1198,7 +1198,7 @@ mesgin_complete:
testSEQ_FLAGS, NOT_IDENTIFIED jnz mesgin_proto_violation;
 
/*
-* If we recevied good status but never successfully sent the
+* If we received good status but never successfully sent the
 * cdb, abort the command.
 */
testSCB_SCSI_STATUS,0xffjnz complete_accepted;
diff --git a/sys/dev/aic7xxx/aic7xxx.seq b/sys/dev/aic7xxx/aic7xxx.seq
index 1ae250d880bf..a94e2dae4149 100644
--- a/sys/dev/aic7xxx/aic7xxx.seq
+++ b/sys/dev/aic7xxx/aic7xxx.seq
@@ -1639,7 +1639,7 @@ mesgin_complete:
testSEQ_FLAGS, NOT_IDENTIFIED jnz mesgin_proto_violation;
 
/*
-* If we recevied good status but never successfully sent the
+* If we received good status but never successfully sent the
 * cdb, abort the command.
 */
testSCB_SCSI_STATUS,0xffjnz complete_accepted;



git: 496432f19216 - main - netinet6: Fix two typos in source code comments

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=496432f192165b8700da4b0ab8ebdd253002e265

commit 496432f192165b8700da4b0ab8ebdd253002e265
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:48:34 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:48:34 +

netinet6: Fix two typos in source code comments

- s/adddress/address/

MFC after:  3 days
---
 sys/netinet6/nd6_nbr.c | 2 +-
 sys/netinet6/scope6.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/netinet6/nd6_nbr.c b/sys/netinet6/nd6_nbr.c
index 7d89fcc4ee69..7b4fa7a8d8c9 100644
--- a/sys/netinet6/nd6_nbr.c
+++ b/sys/netinet6/nd6_nbr.c
@@ -262,7 +262,7 @@ nd6_ns_input(struct mbuf *m, int off, int icmp6len)
}
if (ifa == NULL) {
/*
-* We've got an NS packet, and we don't have that adddress
+* We've got an NS packet, and we don't have that address
 * assigned for us.  We MUST silently ignore it.
 * See RFC2461 7.2.3.
 */
diff --git a/sys/netinet6/scope6.c b/sys/netinet6/scope6.c
index f3cfd4602548..0987ea7e99ad 100644
--- a/sys/netinet6/scope6.c
+++ b/sys/netinet6/scope6.c
@@ -525,7 +525,7 @@ in6_getscopezone(const struct ifnet *ifp, int scope)
 }
 
 /*
- * Extracts scope from adddress @dst, stores cleared address
+ * Extracts scope from address @dst, stores cleared address
  * inside @dst and zone inside @scopeid
  */
 void



git: 9b035689f15f - main - tcp_fastopen: Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=9b035689f15fc4aec96f9c18c6c86bd615faed2f

commit 9b035689f15fc4aec96f9c18c6c86bd615faed2f
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:49:47 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:49:47 +

tcp_fastopen: Fix a typo in a source code comment

- s/posession/possession/

MFC after:  3 days
---
 sys/netinet/tcp_fastopen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netinet/tcp_fastopen.c b/sys/netinet/tcp_fastopen.c
index c31225214d1d..609637b83df3 100644
--- a/sys/netinet/tcp_fastopen.c
+++ b/sys/netinet/tcp_fastopen.c
@@ -43,7 +43,7 @@
  *
  * In addition to the facilities defined in RFC7413, this implementation
  * supports a pre-shared key (PSK) mode of operation in which the TFO server
- * requires the client to be in posession of a shared secret in order for
+ * requires the client to be in possession of a shared secret in order for
  * the client to be able to successfully open TFO connections with the
  * server.  This is useful, for example, in environments where TFO servers
  * are exposed to both internal and external clients and only wish to allow



git: cde9ec6a451d - main - netpfil: Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cde9ec6a451d22ad65fbe602dc57135177c0a865

commit cde9ec6a451d22ad65fbe602dc57135177c0a865
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:50:57 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:50:57 +

netpfil: Fix a typo in a source code comment

- s/strucutre/structure/

MFC after:  3 days
---
 sys/netpfil/ipfilter/netinet/ip_pool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netpfil/ipfilter/netinet/ip_pool.c 
b/sys/netpfil/ipfilter/netinet/ip_pool.c
index 20a3eed5eb4b..2ded49401658 100644
--- a/sys/netpfil/ipfilter/netinet/ip_pool.c
+++ b/sys/netpfil/ipfilter/netinet/ip_pool.c
@@ -1094,7 +1094,7 @@ ipf_pool_flush(ipf_main_softc_t *softc, void *arg, 
iplookupflush_t *fp)
 /*  ipo(I) - pointer to pool structure  */
 /* Locks:   WRITE(ipf_poolrw) or WRITE(ipf_global)  */
 /*  */
-/* Deletes the pool strucutre passed in from the list of pools and deletes  */
+/* Deletes the pool structure passed in from the list of pools and deletes  */
 /* all of the address information stored in it, including any tree data */
 /* structures also allocated.   */
 /*  */



git: c90f1ed10460 - main - netlink(4): Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c90f1ed104606f5a691ea2defc5711ca9d28fcc7

commit c90f1ed104606f5a691ea2defc5711ca9d28fcc7
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:52:16 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:52:16 +

netlink(4): Fix a typo in a source code comment

- s/permament/permanent/

MFC after:  3 days
---
 sys/netlink/route/neigh.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/netlink/route/neigh.h b/sys/netlink/route/neigh.h
index eacacc09711a..10bc3b93d16a 100644
--- a/sys/netlink/route/neigh.h
+++ b/sys/netlink/route/neigh.h
@@ -82,7 +82,7 @@ enum {
 #defineNTF_PROXY   0x0008  /* proxy entry */
 #defineNTF_EXT_LEARNED 0x0010  /* not used */
 #defineNTF_OFFLOADED   0x0020  /* not used */
-#defineNTF_STICKY  0x0040  /* permament entry */
+#defineNTF_STICKY  0x0040  /* permanent entry */
 #defineNTF_ROUTER  0x0080  /* dst indicated itself as a 
router */
 /* start of NDA_FLAGS_EXT */
 #defineNTF_EXT_MANAGED 0x0100  /* not used */



git: ab6d773dbf92 - main - rtsock: Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ab6d773dbf926e4f92e37b67a85c3290cfb90723

commit ab6d773dbf926e4f92e37b67a85c3290cfb90723
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:53:21 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:53:21 +

rtsock: Fix a typo in a source code comment

- s/adddress/address/

MFC after:  3 days
---
 sys/net/rtsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index cb149f176b6d..e4183232700e 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -695,7 +695,7 @@ fill_addrinfo(struct rt_msghdr *rtm, int len, struct 
linear_buffer *lb, u_int fi
 
/* 
 * A host route through the loopback interface is 
-* installed for each interface adddress. In pre 8.0
+* installed for each interface address. In pre 8.0
 * releases the interface address of a PPP link type
 * is not reachable locally. This behavior is fixed as 
 * part of the new L2/L3 redesign and rewrite work. The



git: c1ada3978310 - main - net80211: Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=c1ada39783109c496fde853cc2fe32f31a8f7516

commit c1ada39783109c496fde853cc2fe32f31a8f7516
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:54:36 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:54:36 +

net80211: Fix a typo in a source code comment

- s/recevied/received/

MFC after:  3 days
---
 sys/net80211/ieee80211_hwmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/net80211/ieee80211_hwmp.c b/sys/net80211/ieee80211_hwmp.c
index 429cd69629fc..c47e845bb8a8 100644
--- a/sys/net80211/ieee80211_hwmp.c
+++ b/sys/net80211/ieee80211_hwmp.c
@@ -1395,7 +1395,7 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct 
ieee80211_node *ni,
 
/*
 * Check if we received a PREP w/ AE and store target external address.
-* We may store target external address if recevied PREP w/ AE
+* We may store target external address if received PREP w/ AE
 * and we are not final destination
 */
if (prep->prep_flags & IEEE80211_MESHPREP_FLAGS_AE) {



git: b2c48aa4d192 - main - vmd(4): Fix typos in source code comments

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=b2c48aa4d19268610191a0b7d7b76d01d28b0a13

commit b2c48aa4d19268610191a0b7d7b76d01d28b0a13
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:55:33 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:55:33 +

vmd(4): Fix typos in source code comments

- s/harwdare/hardware/

MFC after:  3 days
---
 sys/dev/vmd/vmd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c
index 42b48da05321..1563d707c6b4 100644
--- a/sys/dev/vmd/vmd.c
+++ b/sys/dev/vmd/vmd.c
@@ -436,7 +436,7 @@ vmd_alloc_resource(device_t dev, device_t child, int type, 
int *rid,
 
switch (type) {
case SYS_RES_IRQ:
-   /* VMD harwdare does not support legacy interrupts. */
+   /* VMD hardware does not support legacy interrupts. */
if (*rid == 0)
return (NULL);
return (bus_generic_alloc_resource(dev, child, type, rid,
@@ -464,7 +464,7 @@ vmd_alloc_resource(device_t dev, device_t child, int type, 
int *rid,
pcib_child_name(child));
break;
default:
-   /* VMD harwdare does not support I/O ports. */
+   /* VMD hardware does not support I/O ports. */
return (NULL);
}
rman_set_rid(res, *rid);
@@ -499,7 +499,7 @@ static int
 vmd_route_interrupt(device_t dev, device_t child, int pin)
 {
 
-   /* VMD harwdare does not support legacy interrupts. */
+   /* VMD hardware does not support legacy interrupts. */
return (PCI_INVALID_IRQ);
 }
 



git: d74371101629 - main - usb: Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=d743711016298046ca77c5661bab41739396a180

commit d743711016298046ca77c5661bab41739396a180
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:57:06 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:57:06 +

usb: Fix a typo in a source code comment

- s/recevied/received/

MFC after:  3 days
---
 sys/dev/usb/serial/umcs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/usb/serial/umcs.h b/sys/dev/usb/serial/umcs.h
index c8c6135710cf..0d34c54a3707 100644
--- a/sys/dev/usb/serial/umcs.h
+++ b/sys/dev/usb/serial/umcs.h
@@ -169,7 +169,7 @@
 #defineMCS7840_DEV_SPx_LOOP_PIPES  0x01/* Loop Bulk-Out FIFO 
to the
 * Bulk-In FIFO, default = 0 */
 #defineMCS7840_DEV_SPx_SKIP_ERR_DATA   0x02/* Drop data bytes from 
UART,
-* which were recevied with
+* which were received with
 * errors, default = 0 */
 #defineMCS7840_DEV_SPx_RESET_OUT_FIFO  0x04/* Reset Bulk-Out FIFO 
*/
 #defineMCS7840_DEV_SPx_RESET_IN_FIFO   0x08/* Reset Bulk-In FIFO */



git: 97a4045aaf36 - main - virtio(4): Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=97a4045aaf36079f54ee05a8cb314b8a90f20af8

commit 97a4045aaf36079f54ee05a8cb314b8a90f20af8
Author: Gordon Bergling 
AuthorDate: 2024-01-22 20:59:06 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 20:59:06 +

virtio(4): Fix a typo in a source code comment

- s/recevied/received/

MFC after:  3 days
---
 sys/dev/virtio/network/virtio_net.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/virtio/network/virtio_net.h 
b/sys/dev/virtio/network/virtio_net.h
index 4dfa4d3341f0..4b728f7af21a 100644
--- a/sys/dev/virtio/network/virtio_net.h
+++ b/sys/dev/virtio/network/virtio_net.h
@@ -210,7 +210,7 @@ struct virtio_net_ctrl_mac {
  * Control link announce acknowledgement
  *
  * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
- * driver has recevied the notification; device would clear the
+ * driver has received the notification; device would clear the
  * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
  * this command.
  */



git: ad92f3d9d0b5 - main - meta2deps.py: Fix a typo in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=ad92f3d9d0b56ee723271152cec9174f74e17cb9

commit ad92f3d9d0b56ee723271152cec9174f74e17cb9
Author: Gordon Bergling 
AuthorDate: 2024-01-22 21:00:36 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 21:00:36 +

meta2deps.py: Fix a typo in a source code comment

- s/follwing/following/

MFC after:  3 days
---
 share/mk/meta2deps.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/share/mk/meta2deps.py b/share/mk/meta2deps.py
index d7820ec71b5b..334a008a2ab5 100755
--- a/share/mk/meta2deps.py
+++ b/share/mk/meta2deps.py
@@ -197,7 +197,7 @@ class MetaFile:
 
 def __init__(self, name, conf={}):
 """if name is set we will parse it now.
-conf can have the follwing keys:
+conf can have the following keys:
 
 SRCTOPS list of tops of the src tree(s).
 



git: e125371fb6ff - main - dwc: Fix two typos in a source code comment

2024-01-22 Thread Gordon Bergling
The branch main has been updated by gbe:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=e125371fb6ff22d452c5ae90d3787432b8bfa0d1

commit e125371fb6ff22d452c5ae90d3787432b8bfa0d1
Author: Gordon Bergling 
AuthorDate: 2024-01-22 21:03:29 +
Commit: Gordon Bergling 
CommitDate: 2024-01-22 21:03:29 +

dwc: Fix two typos in a source code comment

- s/recevied/received/
- s/descriptr/descriptor/

MFC after:  3 days
---
 sys/dev/dwc/dwc1000_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/dwc/dwc1000_dma.c b/sys/dev/dwc/dwc1000_dma.c
index c510c252072c..44b9f0d114bf 100644
--- a/sys/dev/dwc/dwc1000_dma.c
+++ b/sys/dev/dwc/dwc1000_dma.c
@@ -363,7 +363,7 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc 
*desc,
(RDESC0_FS | RDESC0_LS)) {
/*
 * Something very wrong happens. The whole packet should be
-* recevied in one descriptr. Report problem.
+* received in one descriptor. Report problem.
 */
device_printf(sc->dev,
"%s: RX descriptor without FIRST and LAST bit set: 0x%08X",



git: 3f4f82c0d779 - main - bsdlabel: limit to 8 partitions

2024-01-22 Thread Ed Maste
The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=3f4f82c0d7791bddf2d6f2c29d9f2f8c48c712e2

commit 3f4f82c0d7791bddf2d6f2c29d9f2f8c48c712e2
Author: Ed Maste 
AuthorDate: 2024-01-23 02:05:58 +
Commit: Ed Maste 
CommitDate: 2024-01-23 02:17:23 +

bsdlabel: limit to 8 partitions

bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.

As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.

PR: 276517
---
 sbin/bsdlabel/bsdlabel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 2c03117e344a..b831c8ba4ec6 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -50,7 +50,7 @@
 #include 
 #define DKTYPENAMES
 #define FSTYPENAMES
-#define MAXPARTITIONS  20
+#define MAXPARTITIONS  8 /* XXX should be 20, but see PR276517 */
 #include 
 
 #include 



git: a8b2189c90c5 - main - arm/mpic: remove empty pic_init_secondary() hook

2024-01-22 Thread Jessica Clarke
The branch main has been updated by jrtc27:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=a8b2189c90c52e43e27614b2cca6b753a70da0ca

commit a8b2189c90c52e43e27614b2cca6b753a70da0ca
Author: Elliott Mitchell 
AuthorDate: 2024-01-23 02:52:37 +
Commit: Jessica Clarke 
CommitDate: 2024-01-23 02:52:37 +

arm/mpic: remove empty pic_init_secondary() hook

The default hook does nothing, so having an empty handler is pointless.
Simple cleanup.

Reviewed by:markj
MFC after:  1 week
Differential Revision:  https://reviews.freebsd.org/D40475
---
 sys/arm/mv/mpic.c | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/sys/arm/mv/mpic.c b/sys/arm/mv/mpic.c
index 15574e409001..232eb8556948 100644
--- a/sys/arm/mv/mpic.c
+++ b/sys/arm/mv/mpic.c
@@ -149,7 +149,6 @@ static void mpic_unmask_irq_err(uintptr_t nb);
 static boolean_t mpic_irq_is_percpu(uintptr_t);
 static int mpic_intr(void *arg);
 static voidmpic_unmask_msi(void);
-void mpic_init_secondary(device_t);
 void mpic_ipi_send(device_t, struct intr_irqsrc*, cpuset_t, u_int);
 int mpic_ipi_read(int);
 void mpic_ipi_clear(int);
@@ -384,7 +383,6 @@ static device_method_t mv_mpic_methods[] = {
DEVMETHOD(pic_post_filter,  mpic_post_filter),
DEVMETHOD(pic_post_ithread, mpic_post_ithread),
DEVMETHOD(pic_pre_ithread,  mpic_pre_ithread),
-   DEVMETHOD(pic_init_secondary,   mpic_init_secondary),
DEVMETHOD(pic_ipi_send, mpic_ipi_send),
{ 0, 0 }
 };
@@ -565,11 +563,6 @@ mv_msi_data(int irq, uint64_t *addr, uint32_t *data)
return (0);
 }
 
-void
-mpic_init_secondary(device_t dev)
-{
-}
-
 void
 mpic_ipi_send(device_t dev, struct intr_irqsrc *isrc, cpuset_t cpus, u_int ipi)
 {