Re: [PATCH 1/7] em: Print error code and phy/mac type

2018-04-05 Thread Jonathan Gray
On Thu, Apr 05, 2018 at 09:57:17PM +0200, Stefan Fritsch wrote: > Print the error code if hardware initialization failed. > > If EM_DEBUG is defined, print the phy/mac type during attach. ok jsg@ Though these are just enum values we assign that don't come from the hardware. mac_type is set

Re: [PATCH 3/7] em: Add em_check_phy_reset_block() quirk

2018-04-05 Thread Jonathan Gray
On Thu, Apr 05, 2018 at 09:57:19PM +0200, Stefan Fritsch wrote: > Port the logic from freebsd to em_check_phy_reset_block(). A single > read does not seem to be reliable. ok jsg@ > --- > sys/dev/pci/if_em_hw.c | 15 --- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff

Re: [PATCH 7/7] em: Add magic delay for HP elitebook 820 G3

2018-04-05 Thread Jonathan Gray
On Thu, Apr 05, 2018 at 09:57:23PM +0200, Stefan Fritsch wrote: > Add another magic 1ms delay that seems to help with some remaining > issues on an HP elitebook 820 G3 with i219LM. A printf() at the same > place helps, too. Could you explain what the problem here was and why this place was chosen

Re: [PATCH 2/7] em: Increase delay after reset to 20ms

2018-04-05 Thread Jonathan Gray
On Thu, Apr 05, 2018 at 09:57:18PM +0200, Stefan Fritsch wrote: > This is the value in freebsd for ich8lan. ok jsg@ > --- > sys/dev/pci/if_em_hw.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git sys/dev/pci/if_em_hw.c sys/dev/pci/if_em_hw.c > index

Re: [PATCH 6/7] em: Port an i219 errata workaround from FreeBSD

2018-04-05 Thread Jonathan Gray
On Thu, Apr 05, 2018 at 09:57:22PM +0200, Stefan Fritsch wrote: > https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/i218-i219-ethernet-connection-spec-update.pdf?asset=9561 > --- > sys/dev/pci/if_em.c| 4 +++- > sys/dev/pci/if_em_hw.h | 1 + > 2 files changed,

ARP issues when using ldpd(8) and mpw(4)

2018-04-05 Thread Adrian Close
Hi, I'm having some issues getting an mpw(4) MPLS "pseudowire" setup working reliably and it seems to come down to ARP issues between my "PE" and "P" boxes that occur when ldpd(8) thinks the pseudowire l2vpn tunnels are actually up. My setup looks something like: [cust L2] -

Re: Use FREF() & finishdup() in dupfdopen()

2018-04-05 Thread Alexander Bluhm
On Tue, Apr 03, 2018 at 04:43:17PM +0200, Martin Pieuchot wrote: > Here's another refactoring to properly reference count a 'struct file *' > just after calling fd_getfile(). > > Instead of incrementing `f_count' by hand, give the current reference > to finishdup() like it is done in other places

[patch] skip wait4() for power{up,down} in do_etc_file()

2018-04-05 Thread Jesper Wallin
Hi all, I thought of adding another flag to apmd (or modify -A) to make it run with hw.setperf=100 when the power is connected and automatically adjust it when running on battery. While reading the code and manual, I figured the /etc/apm/* actions was a much better solution and added a script

[PATCH 1/7] em: Print error code and phy/mac type

2018-04-05 Thread Stefan Fritsch
Print the error code if hardware initialization failed. If EM_DEBUG is defined, print the phy/mac type during attach. --- sys/dev/pci/if_em.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git sys/dev/pci/if_em.c sys/dev/pci/if_em.c index ec8e35245ef..30df846117c 100644 ---

[PATCH 6/7] em: Port an i219 errata workaround from FreeBSD

2018-04-05 Thread Stefan Fritsch
https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/i218-i219-ethernet-connection-spec-update.pdf?asset=9561 --- sys/dev/pci/if_em.c| 4 +++- sys/dev/pci/if_em_hw.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git sys/dev/pci/if_em.c

[PATCH 3/7] em: Add em_check_phy_reset_block() quirk

2018-04-05 Thread Stefan Fritsch
Port the logic from freebsd to em_check_phy_reset_block(). A single read does not seem to be reliable. --- sys/dev/pci/if_em_hw.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git sys/dev/pci/if_em_hw.c sys/dev/pci/if_em_hw.c index 52d3ee95d15..e5084252c29 100644

[PATCH 4/7] em: Improve access logic for software flag

2018-04-05 Thread Stefan Fritsch
Some em chips have a semaphore ("software flag") to synchronize access to certain registers between OS and firmware (ME/AMT). Make the logic to get the flag match the logic in freebsd. This includes higher timeouts and waiting for a previous unlock to complete before trying a lock again. ---

[PATCH 7/7] em: Add magic delay for HP elitebook 820 G3

2018-04-05 Thread Stefan Fritsch
Add another magic 1ms delay that seems to help with some remaining issues on an HP elitebook 820 G3 with i219LM. A printf() at the same place helps, too. --- sys/dev/pci/if_em_hw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git sys/dev/pci/if_em_hw.c sys/dev/pci/if_em_hw.c index

[PATCH 5/7] em: Make em_get_software_flag() recursive

2018-04-05 Thread Stefan Fritsch
The em driver calls em_get_software_flag() recursively, which causes the semaphore to be unlocked too early. Make em_get_software_flag and em_release_software_flag handle this correctly. Freebsd does not do this, but they have a mutex that probably allows them to detect recursive calls to

[PATCH 2/7] em: Increase delay after reset to 20ms

2018-04-05 Thread Stefan Fritsch
This is the value in freebsd for ich8lan. --- sys/dev/pci/if_em_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git sys/dev/pci/if_em_hw.c sys/dev/pci/if_em_hw.c index df0fa571736..52d3ee95d15 100644 --- sys/dev/pci/if_em_hw.c +++ sys/dev/pci/if_em_hw.c @@ -945,7 +945,7 @@

plug memory leak in ASN1_item_digest

2018-04-05 Thread Theo Buehler
If EVP_Digest() fails, str is leaked. This is part of the combo-diff 83b4049ab75e9da1815e9c854a9297bca3d4af6b some more of which may also apply to us, but I'm still disentangling it. See also https://github.com/openssl/openssl/issues/2111 Index: lib/libcrypto/asn1/a_digest.c

Re: httpd socket leak - Re: httpd ranges are not liked by freshclam

2018-04-05 Thread Claudio Jeker
On Thu, Apr 05, 2018 at 08:59:56AM +0200, Florian Obser wrote: > > this fixes it for me, instead of goto done we could also set > clt->clt_done = 1; but at this point it means the same, I think... > > diff --git server_http.c server_http.c > index 414e297f082..53e78b62f31 100644 > ---

Re: binutils: build with LLVM 6.0.0

2018-04-05 Thread Alexander Bluhm
On Thu, Apr 05, 2018 at 06:06:59PM +0200, Patrick Wildt wrote: > Does this still compile with LLVM 5.0.1? No. cc -DHAVE_CONFIG_H -I. -I/usr/src/gnu/usr.bin/binutils-2.17/gas -I. -D_GNU_SOURCE -I. -I/usr/src/gnu/usr.bin/binutils-2.17/gas -I../bfd -I/usr/src/gnu/usr.bin/binutils-2.17/gas/config

Re: binutils: build with LLVM 6.0.0

2018-04-05 Thread Patrick Wildt
On Sat, Mar 31, 2018 at 10:57:38PM +0200, Mark Kettenis wrote: > I'm not sure about the obstack.h bit; why does it complain about > __INT_TO_PTR but not about __PTR_TO_INT? So, I think what the code in question is trying to do is convert a ptr to a a different type while keeping the same "number"

Re: Looking for testers for em(4) quirks patch

2018-04-05 Thread Theo de Raadt
Stefan Fritsch wrote: > > > Ie I wonder if the sw_flag parts could be done differently but other > > > parts could go in without that. > > In the long term, it may be a good idea to scrap all files except if_em.c, > write an openbsd specific e1000_osdep.c, and import all

Re: FREF() for namei()

2018-04-05 Thread Alexander Bluhm
On Tue, Apr 03, 2018 at 04:46:56PM +0200, Martin Pieuchot wrote: > namei() currently uses fd_getfile() without calling FREF()/FRELE() > because it doesn't sleep before grabbing a reference on the vnode. > > This won't be enough as soon as we start unlocking some syscalls, > so add a

Re: Earlier FREF() for sys_ioctl()

2018-04-05 Thread Alexander Bluhm
On Tue, Apr 03, 2018 at 04:48:09PM +0200, Martin Pieuchot wrote: > Similar to other diffs, this one move a FREF() right after > fd_getfile_mode(), ok? OK bluhm@ > Index: kern/sys_generic.c > === > RCS file:

Re: httpd socket leak - Re: httpd ranges are not liked by freshclam

2018-04-05 Thread trondd
On Thu, April 5, 2018 2:59 am, Florian Obser wrote: > > this fixes it for me, instead of goto done we could also set > clt->clt_done = 1; but at this point it means the same, I think... > > diff --git server_http.c server_http.c > index 414e297f082..53e78b62f31 100644 > --- server_http.c > +++

Re: high sofnet load with gif(4) and icmp

2018-04-05 Thread Marc Peters
On Thu, Apr 05, 2018 at 02:38:36PM +0200, Alexander Bluhm wrote: > OK bluhm@ > > On Thu, Apr 05, 2018 at 09:14:32AM +1000, David Gwynne wrote: > > Index: if_gif.c > > === > > RCS file: /cvs/src/sys/net/if_gif.c,v > > retrieving

Re: high sofnet load with gif(4) and icmp

2018-04-05 Thread Job Snijders
Hi, I'm optimistic about this patch: where previously running traffic through this router over gif tunnels would result in memory exhaustion, the problem now seems gone. memory graph: http://instituut.net/~job/screenshots/ee7f0fa5304032a2.png Should perhaps an errata / syspatch blob be prepared

Re: high sofnet load with gif(4) and icmp

2018-04-05 Thread Alexander Bluhm
OK bluhm@ On Thu, Apr 05, 2018 at 09:14:32AM +1000, David Gwynne wrote: > Index: if_gif.c > === > RCS file: /cvs/src/sys/net/if_gif.c,v > retrieving revision 1.113 > diff -u -p -r1.113 if_gif.c > --- if_gif.c 15 Mar 2018 21:01:18

udp pf inp lookup

2018-04-05 Thread Alexander Bluhm
Hi, To speed up socket lookups it is possible to use the existing pf state. For UDP this is currently disabled as there were some stability issues. I have strong indication that the crashes were fixed when reference counting for pf states was implemented. So I would like to reenable this code.

Re: httpd socket leak - Re: httpd ranges are not liked by freshclam

2018-04-05 Thread Kevin Chadwick
On Wed, 4 Apr 2018 23:58:05 +0100 > TBH I'd probably just disable range processing like done in > https://ftp.openbsd.org/pub/OpenBSD/patches/6.0/common/017_httpd.patch.sig > for now, neither memory exhaustion nor FD leak are particularly > appealing. I believe this broke html5 video for

Re: Looking for testers for em(4) quirks patch

2018-04-05 Thread Stefan Fritsch
On Thu, 5 Apr 2018, Mark Kettenis wrote: > > Date: Thu, 5 Apr 2018 02:02:20 +1000 > > From: Jonathan Gray > > > > On Mon, Apr 02, 2018 at 11:52:08AM +0200, Stefan Fritsch wrote: > > > Hi, > > > > > > We have seen problems with em on i219V and i219LM. For example, "Hardware > >

Re: httpd socket leak - Re: httpd ranges are not liked by freshclam

2018-04-05 Thread Florian Obser
this fixes it for me, instead of goto done we could also set clt->clt_done = 1; but at this point it means the same, I think... diff --git server_http.c server_http.c index 414e297f082..53e78b62f31 100644 --- server_http.c +++ server_http.c @@ -701,6 +701,8 @@ server_read_httprange(struct