AUDIO_DEV_SOUND

2017-05-15 Thread Jan Stary
While /dev/sound is no more, the #define AUDIO_DEV_SOUND 0 /* minor of /dev/sound0 */ apparently cannot be just removed from dev/audio.c - with the diff below, all audio applications complain that the default audio device cannot be opened. Why is that? That comment seems

commit regarding boot-time rng

2017-05-15 Thread Theo de Raadt
I wanted to highlight this commit. On some architectures we use a system bootloader rather than our own bootloader. In this particular case an octeon bootloader would be hard to write, becuase it needs native drivers for some very complicated peripherals. So the solution is to have the kernel

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Miod Vallat
> So I implemented a new function called > copyin_futex(9), which is all we really need. But it is not specific to futex - in fact, it could be used in syscall() as well. Better call it fuword() or aligned_fuword() since it has the extra alignment requirement that

Enable NET_LOCK(), take 3

2017-05-15 Thread Martin Pieuchot
Here's the diff that got reverted before release. My plan is to enable it and then get rid of the remaining splsoftnet() to be able to fix the remaining XXXSMP. ok? Index: kern/uipc_socket.c === RCS file:

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Martin Pieuchot
On 14/05/17(Sun) 22:05, Mark Kettenis wrote: > > Date: Fri, 12 May 2017 13:34:38 + > > From: Visa Hankala > > > > On Mon, May 01, 2017 at 06:02:24PM +0200, Mark Kettenis wrote: > > > The futex(2) syscall needs to be able to atomically copy the futex in > > > and out of

NFS is IPL_SOFTNET free

2017-05-15 Thread Martin Pieuchot
Outside of USB, no code is executed in a softnet interrupt context. So what's protecting NFS data structures is the KERNEL_LOCK(). But more importantly, since r1.114 of nfs_socket.c, the 'softnet' thread is no longer executing NFS code. So all these splsoftnet() can disappear. Ok? Index:

gif(4) vs splnet()

2017-05-15 Thread Martin Pieuchot
Similar to gre(4), the global list of interfaces needs to be protected by the NET_LOCK(). ok? Index: net/if_gif.c === RCS file: /cvs/src/sys/net/if_gif.c,v retrieving revision 1.94 diff -u -p -r1.94 if_gif.c --- net/if_gif.c

Re: splsoftnet() in SO_SPLICE

2017-05-15 Thread Alexander Bluhm
On Mon, May 15, 2017 at 01:20:02PM +0200, Martin Pieuchot wrote: > Here's the last of the splsoftnet(), is it ok if I replace it with a > KERNEL_LOCK() to make it clear this needs protection? I think it needs the socket lock. somove() is modifying the so_splicelen value. somove() calls

Re: Enable NET_LOCK(), take 3

2017-05-15 Thread Alexander Bluhm
On Mon, May 15, 2017 at 11:49:18AM +0200, Martin Pieuchot wrote: > Here's the diff that got reverted before release. My plan is to enable > it and then get rid of the remaining splsoftnet() to be able to fix the > remaining XXXSMP. > > ok? This diff looks familiar. Put it in so we can fix

Re: splsoftnet() in SO_SPLICE

2017-05-15 Thread Alexander Bluhm
On Mon, May 15, 2017 at 02:32:07PM +0200, Martin Pieuchot wrote: > On 15/05/17(Mon) 13:35, Alexander Bluhm wrote: > > On Mon, May 15, 2017 at 01:20:02PM +0200, Martin Pieuchot wrote: > > > Here's the last of the splsoftnet(), is it ok if I replace it with a > > > KERNEL_LOCK() to make it clear

mpw(4) vs splnet()

2017-05-15 Thread Martin Pieuchot
if_input() does not need to be protected, ok? Index: net/if_mpw.c === RCS file: /cvs/src/sys/net/if_mpw.c,v retrieving revision 1.21 diff -u -p -r1.21 if_mpw.c --- net/if_mpw.c4 May 2017 15:00:24 - 1.21 +++

Get rid of splsoftassert(IPL_SOFTNET)

2017-05-15 Thread Martin Pieuchot
I insisted we keep this macro to differentiate which code has been audited and really need the NET_LOCK() until we were ready to switch. This time has come, so I'd like to replace all of them. This will allow us to get rid of the SPL dance altogether and turn the NET_LOCK() free of any argument.

Re: rasops: fix virtual console initialization

2017-05-15 Thread Stefan Sperling
On Sun, May 14, 2017 at 08:44:54PM -0500, joshua stein wrote: > Only copy the console buffer contents to a rasops virtual console if > it's the first one (visible). > > Otherwise all of the other virtual consoles initialize with the > trailing end of the kernel messages and then getty writes over

splsoftnet() in SO_SPLICE

2017-05-15 Thread Martin Pieuchot
Here's the last of the splsoftnet(), is it ok if I replace it with a KERNEL_LOCK() to make it clear this needs protection? Index: kern/uipc_socket.c === RCS file: /cvs/src/sys/kern/uipc_socket.c,v retrieving revision 1.182 diff -u -p

Re: [patch] ND_COMPUTER_RTIME is not uniformly distributed

2017-05-15 Thread Matthew Martin
ping On Sun, May 07, 2017 at 06:59:12PM -0500, Matthew Martin wrote: > RFC 4861 specifies ReachableTime "should be a uniformly distributed > random value between MIN_RANDOM_FACTOR and MAX_RANDOM_FACTOR times > BaseReachableTime milliseconds." I think the author intended to do the > multiplication

Re: splsoftnet() in SO_SPLICE

2017-05-15 Thread Martin Pieuchot
On 15/05/17(Mon) 13:35, Alexander Bluhm wrote: > On Mon, May 15, 2017 at 01:20:02PM +0200, Martin Pieuchot wrote: > > Here's the last of the splsoftnet(), is it ok if I replace it with a > > KERNEL_LOCK() to make it clear this needs protection? > > I think it needs the socket lock. somove() is

Most of the splnet() in /sys/net are wrong

2017-05-15 Thread Martin Pieuchot
They all need to be audited and possibly changed to a solution that work with the NET_LOCK(). Just saying, enc(4) is a nightmare. Here's a diff fro gre(4). The 'softnet' iterates over ``gre_softc_list'' so we need to make sure it isn't modified when this happen. We need the NET_LOCK() were

pflog(4) vs splnet()

2017-05-15 Thread Martin Pieuchot
Kill unused global list of softc and protect the global array of interface by the NET_LOCK(). ok? Index: net/if_pflog.c === RCS file: /cvs/src/sys/net/if_pflog.c,v retrieving revision 1.78 diff -u -p -r1.78 if_pflog.c ---

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Visa Hankala
On Sun, May 14, 2017 at 10:05:28PM +0200, Mark Kettenis wrote: > I tried to convert a few more architectures, and things get a bit > messier than I envisioned on architectures that have an optimized copy > function and care about alignment. Especially when copyin(9) is > implemented in assembly.

Re: AUDIO_DEV_SOUND

2017-05-15 Thread Alexandre Ratchov
On Mon, May 15, 2017 at 10:14:48AM +0200, Jan Stary wrote: > While /dev/sound is no more, the > > #define AUDIO_DEV_SOUND 0 /* minor of /dev/sound0 */ > > apparently cannot be just removed from dev/audio.c > - with the diff below, all audio applications complain > that the

Re: pf: percpu anchor stacks

2017-05-15 Thread Alexandr Nedvedicky
Hello, > Now *is* the time to commit the first step, the refactoring. Once > that's done we can discuss the introduction of the context. > > Could you come up with such diff? first of all: I have not managed to finish the re-factoring step yet, work is still in progress. I stole some

Re: Most of the splnet() in /sys/net are wrong

2017-05-15 Thread Alexander Bluhm
On Mon, May 15, 2017 at 03:06:08PM +0200, Martin Pieuchot wrote: > They all need to be audited and possibly changed to a solution that work > with the NET_LOCK(). Just saying, enc(4) is a nightmare. > > Here's a diff fro gre(4). The 'softnet' iterates over ``gre_softc_list'' > so we need to

Re: [patch] ND_COMPUTER_RTIME is not uniformly distributed

2017-05-15 Thread Mike Belopuhov
On Sun, May 07, 2017 at 18:59 -0500, Matthew Martin wrote: > RFC 4861 specifies ReachableTime "should be a uniformly distributed > random value between MIN_RANDOM_FACTOR and MAX_RANDOM_FACTOR times > BaseReachableTime milliseconds." I think the author intended to do the > multiplication by (x>>10)

Re: Atomic copyin(9)/copyout(9) for amd64

2017-05-15 Thread Mark Kettenis
> From: Miod Vallat > Date: Mon, 15 May 2017 06:06:22 + (UTC) > > > So I implemented a new function called > > copyin_futex(9), which is all we really need. > > But it is not specific to futex - in fact, it could be used in syscall() > as well. > >

pf.conf.5: mention the inversion (!) operator

2017-05-15 Thread Michal Mazurek
- mention the inversion operator for "some parameters" - mention the inversion operator for "received-on" to match "tagged" - don't wrap a short line - use spaces, not tabs inside a literal block - quote the inversion operator when describing BNF syntax (easy to miss): - "label"

event(3): mention bufferevent_setwatermark

2017-05-15 Thread Anton Lindqvist
Hi, The bufferevent_setwatermark function is not mentioned in event(3). Maybe the function deserves to be documented under the "BUFFERED EVENTS" section but I know too little about the API to determine if that would be useful. Some docs regarding the function can however be found in the event.h

Re: pf queue definition: bandwidth resolution problem

2017-05-15 Thread Mike Belopuhov
On Sun, May 14, 2017 at 21:08 +, Carl Mascott wrote: > OK, I was indeed missing something. Thanks, Theo and Mike. > > I think I see another very minor problem, though. > Let the pf BW be 9,999,999. > Shift right 3 digits (divide by 1000) : yields 9,999K. > (If we were doing floating point

Displaying flow queue in the systat

2017-05-15 Thread Mike Belopuhov
Here are some bits to display flow queues alongside H-FSC ones. It's a bit hackish in a way I switch the "bandwidth" field to the "bandwidth or flows" and then use node->qstats.data.period because I'm too lazy to change the pfctl_queue_node to include a union... This will require changes in the

Re: multipath / route priority support for ospf6d

2017-05-15 Thread Florian Riehm
On 05/12/17 18:07, Florian Riehm wrote: > Hi, > > our QA reports issues with the ospf6d since the kernel uses more multipath > routes. > It exits after certain topology changes with: > rde_send_change_kroute: no valid nexthop found > > Since the kernel uses more multipath routes, the lack of

Re: AUDIO_DEV_SOUND

2017-05-15 Thread Jan Stary
On May 15 16:36:41, a...@caoua.org wrote: > On Mon, May 15, 2017 at 10:14:48AM +0200, Jan Stary wrote: > > While /dev/sound is no more, the > > > > #define AUDIO_DEV_SOUND 0 /* minor of /dev/sound0 */ > > > > apparently cannot be just removed from dev/audio.c > > - with the

Switch relayd to libtls

2017-05-15 Thread Claudio Jeker
Promised this some time ago. This diff switches relayd from libssl to libtls. I decided to only do the refactoring so no new features have been added. I have tested the various modes of relayd and they still behave the same as before. This is a huge diff and needs some major testing (at least the

Re: pf queue definition: bandwidth resolution problem

2017-05-15 Thread Theo Buehler
On Mon, May 15, 2017 at 09:28:57PM +0200, Mike Belopuhov wrote: > On Sun, May 14, 2017 at 21:08 +, Carl Mascott wrote: > > OK, I was indeed missing something. Thanks, Theo and Mike. > > > > I think I see another very minor problem, though. > > Let the pf BW be 9,999,999. > > Shift right 3

Re: [patch] ND_COMPUTER_RTIME is not uniformly distributed

2017-05-15 Thread Matthew Martin
On Mon, May 15, 2017 at 03:49:55PM +0200, Mike Belopuhov wrote: > On Sun, May 07, 2017 at 18:59 -0500, Matthew Martin wrote: > > RFC 4861 specifies ReachableTime "should be a uniformly distributed > > random value between MIN_RANDOM_FACTOR and MAX_RANDOM_FACTOR times > > BaseReachableTime

Re: pflog(4) vs splnet()

2017-05-15 Thread Alexander Bluhm
On Mon, May 15, 2017 at 03:23:02PM +0200, Martin Pieuchot wrote: > Kill unused global list of softc and protect the global array of > interface by the NET_LOCK(). > > ok? OK bluhm@ > > Index: net/if_pflog.c > === > RCS file:

Re: pf: percpu anchor stacks

2017-05-15 Thread Mike Belopuhov
On Mon, May 15, 2017 at 15:19 +0200, Alexandr Nedvedicky wrote: > Hello, > > > Now *is* the time to commit the first step, the refactoring. Once > > that's done we can discuss the introduction of the context. > > > > Could you come up with such diff? > > first of all: I have not managed to