piixpm(4) support for AMD FCH watchdog

2020-02-07 Thread Nathanael Rensen
The diff below adds support for the watchdog as found in the embedded AMD FCH (fusion controller hub) as found on APU2. Index: sys/dev/pci/piixpm.c === RCS file: /cvs/src/sys/dev/pci/piixpm.c,v retrieving revision 1.42 diff -u -p -r1.

em(4) reset I210 wake status

2020-02-05 Thread Nathanael Rensen
When I boot an APU2 using wake-on-lan and then attempt to power off with shutdown -hp it wakes itself up again. To prevent this it is necessary to clear the I210 PME_STATUS flag. This is described in section 5.6.2 of the I210 datasheet: The PE_WAKE_N remains asserted until the operating system e

gpio(4) support for APU2

2020-01-29 Thread Nathanael Rensen
The diff below adds gpio(4) support to wbsio(4) for Nuvoton NCT5104D (pcengines APU2). It is based on Matt Dainty's diff posted to this list in November 2018: https://marc.info/?l=openbsd-tech&m=154134941027009&w=2 A key difference from Matt Dainty's original diff is the use of config_search()

Re: ld.so speedup (part 1)

2019-05-08 Thread Nathanael Rensen
On Mon 6, May 2019 at 00:16:57, Nathanael Rensen wrote: > On Sun, 5 May 2019 at 06:41, Martin Pieuchot wrote: [snip] > > Do I understand correctly that you're not recursing if not object is > > inserted? > > Yes. > > You have probably also noticed that us

Re: ld.so speedup (part 2)

2019-05-05 Thread Nathanael Rensen
On Sun, 5 May 2019 at 06:26, Martin Pieuchot wrote: > > On 27/04/19(Sat) 21:55, Nathanael Rensen wrote: > > The diff below speeds up ld.so library intialisation where the dependency > > tree is broad and deep, such as samba's smbd which links over 100 libraries. > &

Re: ld.so speedup (part 1)

2019-05-05 Thread Nathanael Rensen
On Sun, 5 May 2019 at 06:41, Martin Pieuchot wrote: > > On 27/04/19(Sat) 21:45, Nathanael Rensen wrote: > > The diff below speeds up ld.so library loading where the dependency tree > > is broad and deep, such as samba's smbd which links over 100 libraries. > &

ld.so speedup (part 2)

2019-04-27 Thread Nathanael Rensen
The diff below speeds up ld.so library intialisation where the dependency tree is broad and deep, such as samba's smbd which links over 100 libraries. See for example https://marc.info/?l=openbsd-misc&m=155007285712913&w=2 See https://marc.info/?l=openbsd-tech&m=155637285221396&w=2 for part 1 tha

ld.so speedup (part 1)

2019-04-27 Thread Nathanael Rensen
The diff below speeds up ld.so library loading where the dependency tree is broad and deep, such as samba's smbd which links over 100 libraries. See for example https://marc.info/?l=openbsd-misc&m=155007285712913&w=2 The timings below are for ldd /usr/local/sbin/smbd: Timing without diff: 2m02.

Re: AMRR improvements for rt2860

2016-05-17 Thread Nathanael Rensen
On 27 April 2016 at 17:33, Stefan Sperling wrote: > This version includes minor tweak: When the AP goes down, we don't > need to send disassoc frames to nodes in COLLECT state. While testing this diff I found some additional ieee80211 code paths that rely on ni_associd == 0 to detect a non-assoc

AMRR improvements for rt2860

2016-04-23 Thread Nathanael Rensen
I have been using an rt2860 hostap for a few years and I have discovered that AMRR does not work properly for this driver. The symptom is that some stations get stuck at 1 Mbps and do not progress up to faster rates. Unlike many drivers, rt2860 does not keep the ieee80211_amrr_node on its rt2860_n

Re: preserve /etc and /var file ownership during make build

2016-03-06 Thread Nathanael Rensen
On 7 March 2016 at 08:49, Theo de Raadt wrote: >> During make build the distrib/sets/makeetcset script does not preserve >> ownership when installing /etc and /var files from the base set. >> >> I've noticed that this leads to some discrepancies compared with a normal >> install / upgrade. > >Then

preserve /etc and /var file ownership during make build

2016-03-05 Thread Nathanael Rensen
During make build the distrib/sets/makeetcset script does not preserve ownership when installing /etc and /var files from the base set. I've noticed that this leads to some discrepancies compared with a normal install / upgrade. Nathanael Index: makeetcset ===

maillog mode

2016-02-15 Thread Nathanael Rensen
About four months ago the mode for maillog was changed from 600 to 640 in newsyslog.conf, but the Makefile that creates this file was not updated. Nathanael Index: Makefile === RCS file: /cvs/src/etc/Makefile,v retrieving revision 1.

sis(4) induced uvm faults on net4801

2016-01-07 Thread Nathanael Rensen
tl;dr: Zero-length packets from sis(4) on net4801 result in negative length mbufs causing uvm faults. I have observed uvm faults shortly after bringing up a sis(4) interface on a Soekris net4801: uvm_fault(0xd3adbbf0, 0xd3ee5000, 0, 1) -> e kernel: page fault trap, code=0 Stopped at memcpy+0

pfctl(8) detect multiple root queues on one interface

2015-12-11 Thread Nathanael Rensen
pfctl(8) doesn't check that there is at most one root queue per interface. For example: queue r0 on $if bandwidth 100M default queue r1 on $if bandwidth 100M default # pfctl -f /etc/pf.conf pfctl: DIOCXCOMMIT: Invalid argument Below is a diff for pfctl(8) to detect and report this situation

Avoid -nan for ping std-dev

2015-11-28 Thread Nathanael Rensen
Sometimes floating point imprecision in the calculation of the standard deviation of round-trip latency by ping(8) / ping6(8) leads to attempting to evaluate the sqrt(3) of a negative value: $ ping -c 1 www.google.com PING www.google.com (150.101.170.166): 56 data bytes 64 bytes from 150.101.170.1

Redundant logic in /etc/rc.d/spamlogd

2015-09-12 Thread Nathanael Rensen
The logic to disable spamlogd when spamd is not enabled was added to _rc_quirks() in /etc/rc.d/rc.subr. The corresponding logic that remains in /etc/rc.d/spamlogd became ineffective when additional code was added below it anyway. Index: spamlogd

RFC 5071 DHCP options

2015-08-28 Thread Nathanael Rensen
I use dhcpd(8) to boot some boxes with PXELINUX. The numbered options work but dhcpd.conf(5) is easier to maintain with names. These options are defined in RFC 5071. Nathanael Index: sbin/dhclient/tables.c === RCS file: /cvs/src/sbin

ntpd(8) constraint with a uniprocessor kernel

2015-06-26 Thread Nathanael Rensen
With ntpd(8) on a uniprocessor kernel (i386/amd64) I've found that poll(2) often reacts to the SIGCHLD from a constraint child process before the response message is received. Then constraint_check_child() closes the fd and the response is lost. # /usr/sbin/ntpd -dvs ntp engine ready constraint re

Fix for smtpd offline enqueue

2015-05-01 Thread Nathanael Rensen
The smtpd enqueue -S option does not take an argument. An email enqueued offline with only the -t option (e.g. vi recovery) results in the options "-S -t" passed to smtpd enqueue. The -t is ignored resulting in: debug: smtpd: scanning offline queue... debug: smtpd: enqueueing offline message /va

Fix for shutdown(8) +minutes

2015-04-22 Thread Nathanael Rensen
Errant semicolon preventing shutdown(8) +minutes from working: Index: shutdown.c === RCS file: /cvs/src/sbin/shutdown/shutdown.c,v retrieving revision 1.42 diff -u -p -r1.42 shutdown.c --- shutdown.c 18 Apr 2015 18:28:37 - 1

TLS_READ_AGAIN and TLS_WRITE_AGAIN

2015-04-18 Thread Nathanael Rensen
The tls_init(3) man page states: The tls_close(), tls_read() and tls_write() functions, along with the tls_accept() and tls_connect() function families, have two special return values: TLS_READ_AGAIN A read operation is necessary to continue. TLS_WRITE_AGAIN

autoinstall(8) tweaks

2015-04-06 Thread Nathanael Rensen
A couple of autoinstall(8) tweaks that I find useful. I find it convenient to be able to specify a path to the response file. I also prefer to use the DHCP supplied hostname rather than the MAC address. Index: install.sub === RCS fil

Re: Flag to set from address in mail(1)

2015-01-07 Thread Nathanael Rensen
On Wed, 07 Jan 2015 14:31:13 -0700, Todd C. Miller wrote: > Here's a version that does not rely on non-standard "sendmail -t" > behavior. > > - todd Much better. Works well for me, thanks. Nathanael > Index: usr.bin/mail/cmd3.c > ===

Re: Flag to set from address in mail(1)

2015-01-06 Thread Nathanael Rensen
On Mon, 05 Jan 2015 22:26:03 -0500, trondd wrote: >> >> I like this better. But I still want the set from="XXX" in .mailrc and >> of course the manpage. >> > >I would like to have this option. The diff doesn't work, however. If >you reply to a message, it messes up the header and replyall will cra

Re: Flag to set from address in mail(1)

2015-01-04 Thread Nathanael Rensen
On Sun, 04 Jan 2015 05:57:38 +, Martin Brandenburg wrote: > Since the ability to pass arbitrary arguments to sendmail has been > removed from mail(1), I have added a variable and flag to pass a from > address to sendmail. > > I considered making mail take the same arguments for this as it woul

Re: Perl build race building .bs files

2015-01-01 Thread Nathanael Rensen
On Thu, 1 Jan 2015 13:47:59 -0700, Andrew Fresh wrote: > I had seen complaints but was unable to reproduce the problem myself. > Nathanael Rensen sent me an email out of the blue with both the likely > culprit as well as a patch to fix. A few days after receiving this > patch, an

IEEE80211_DEBUG

2014-07-23 Thread Nathanael Rensen
The IEEE80211_DEBUG kernel option needs a little help to compile. Index: ieee80211_pae_input.c === RCS file: /cvs/src/sys/net80211/ieee80211_pae_input.c,v retrieving revision 1.19 diff -u -p -r1.19 ieee80211_pae_input.c --- ieee80211_

sysmerge auto update

2014-07-20 Thread Nathanael Rensen
Since the switch to SHA256, sysmerge(8) has stopped auto-upgrading files without local changes. $ diff -u a b | grep -E '^\+' | sed '1d' +SHA256 (./etc/rc) = 0e1cb2e6c6d11941dab14853a8ab1888f1b14fad6588fa3e6230b8ef16b62ffd $ diff -u a b | grep -E '^\+' | sed '1d' | awk '{print $3}' = $ diff -u

tcpdump(8) not printing llc data for ieee80211

2014-07-18 Thread Nathanael Rensen
Sometimes tcpdump(8) does not print llc & higher layer data when using -y IEEE802_11 or IEEE802_11_RADIO. Index: print-802_11.c === RCS file: /cvs/src/usr.sbin/tcpdump/print-802_11.c,v retrieving revision 1.13 diff -u -p -r1.13 print-

Modifying queues while pf is disabled

2014-07-01 Thread Nathanael Rensen
When pf is disabled (pfctl -d), pf_remove_queues() detaches hfsc from the interface but the queues are not removed from pf_queues_active. The next time pf rules are loaded, pf_commit_queues() calls pf_remove_queues() and in turn hfsc_delqueue() for each queue in pf_queues_active. This fails since

ntpd(8) losing sync

2014-01-29 Thread Nathanael Rensen
I noticed that ntpd(8) was regularly reporting it was unsynced, which in turn impacts down stream clients. ntpd_adjtime() in usr.sbin/ntpd/ntpd.c uses the olddelta returned by adjtime(2) to determine whether the previous adjustment was completed. The clock is considered to be synced only if olddel

pflow(4) with optional flowsrc

2014-01-18 Thread Nathanael Rensen
Some time ago I proposed a diff to allow pflow(4) to determine the src IP address based on the route table if flowsrc was not specified. That diff was not accepted because having multiple places look up route tables is undesirable. Since then henning@ moved UDP checksum calcs into ip_output. That

pflow(4) without flowsrc

2013-08-30 Thread Nathanael Rensen
If no flowsrc is specified on a pflow(4) interface then the src address is determined by ip_output(). However prior to calling ip_output() pflow(4) has already calculated the UPD pseudo-header checksum based on INADDR_ANY. This results in a bad UPD checksum and the resulting pflow packet is rejecte

Re: 802.11 power save fixes

2012-10-10 Thread Nathanael Rensen
On 10 October 2012 17:54, Mark Kettenis wrote: > Your RT2860-based AP still works reliably with power saving support > enabled? If so I'll probably commit that part of the diff as well. Yes it's working well. Since enabling power saving on my RT2860 AP I haven't noticed any problems with station

802.11 power save fixes

2012-09-28 Thread Nathanael Rensen
I enabled power save for an rt2860 AP using the following diff: Index: sys/dev/ic/rt2860.c === RCS file: /cvs/src/sys/dev/ic/rt2860.c,v retrieving revision 1.65 diff -u -p -r1.65 sys/dev/ic/rt2860.c --- sys/dev/ic/rt2860.c 23 Oct 2010

acpi & ioapic related diffs

2011-06-04 Thread Nathanael Rensen
I have included some diffs below that I have been accumulating. a) sys/dev/acpi/acpi.c & sys/dev/acpi/acpicpu.c This diff is to support ACPI in a Xen HVM. I posted this previously (http://marc.info/?l=openbsd-tech&m=128120981015035&w=2), but my timing was poor - it was late in a release cycle and

Tiny newsyslog(8) diff

2011-05-17 Thread Nathanael Rensen
Poking around in newsyslog(8) I noticed: $ grep MIN_SIZE newsyslog.c #define MIN_SIZE256 /* Don't rotate if smaller (in bytes) */ && ((ent->flags & CE_BINARY) || size >= MIN_SIZE { hence: Index: newsyslog.8 =

Re: ACPI systems without legacy mode

2010-08-08 Thread Nathanael Rensen
ted to know the model of the machine. There should be no effect on currently working ACPI systems, although a confirmation of that would be much appreciated too. Thanks very much, Nathanael On 8 August 2010 03:34, Nathanael Rensen wrote: > Some ACPI systems do not support legacy mode and

ACPI systems without legacy mode

2010-08-07 Thread Nathanael Rensen
Some ACPI systems do not support legacy mode and do not provide an smi_cmd port within the FADT. This is mentioned in the following: http://www.acpi.info/DOWNLOADS/ACPIspec40a.pdf (p119, SMI_CMD) http://wiki.osdev.org/ACPI (Switching to ACPI Mode) OpenBSD aborts ACPI initialisation if the FADT do

Building on i386 with DESTDIR

2010-07-16 Thread Nathanael Rensen
I've found I need a few diffs to build my i386 system cleanly with gcc4 when the DESTDIR variable is set. 1) When DESTDIR is set, /usr/share/mk/bsd.sys.mk sets the gcc -nostdinc flag and adds include directories pointing within the DESTDIR. However, two additional directories are required to repl

RT2860 GTK update

2010-06-05 Thread Nathanael Rensen
I am using a Ralink RT2860 with OpenBSD 4.7 in a Soekris net4801 in hostap mode as a wireless access point. After a group temporal key (GTK) update broadcasts stop being received by the attached stations. If the GTK update reuses the same RT2860 shared key slot then the problem goes away: Index: i