Re: pfioctl: DIOCGETQUEUE: drop net lock

2023-04-28 Thread Alexandr Nedvedicky
Hello, On Fri, Apr 28, 2023 at 09:02:35PM +, Klemens Nanni wrote: > Same logic and argument as for the parent *S ioctl, might as well have > committed them together: > --- > Remove net lock from DIOCGETQUEUES > > Both ticket and number of queues stem from the pf_queues_active list

pfioctl: DIOCGETQUEUE: drop net lock

2023-04-28 Thread Klemens Nanni
Same logic and argument as for the parent *S ioctl, might as well have committed them together: --- Remove net lock from DIOCGETQUEUES Both ticket and number of queues stem from the pf_queues_active list which is effectively static to pf_ioctl.c and fully protected by the pf lock.

Re: Initialize `rtentry_pool' with IPL_SOFTNET IPL

2023-04-28 Thread Vitaliy Makkoveev
> On 28 Apr 2023, at 15:38, Alexander Bluhm wrote: > > On Fri, Apr 28, 2023 at 02:51:23PM +0300, Vitaliy Makkoveev wrote: >>> On 28 Apr 2023, at 14:03, Alexander Bluhm wrote: >>> >>> That basically means we must never call one of the pool get or put >>> functions with kernel lock. This may be

vmd(8): allow vm owners to override boot kernel

2023-04-28 Thread Dave Voutila
The diff below adapts the way vmctl & vmd handle opening kernel images when a vmctl user provides the -b argument and a path. This moves the file opening into vmctl, as the current user, and passes the fd to vmd. With some tweaks, it checks for this user-provided boot fd and uses it as an override

Re: Remove kernel lock from rtfree(9)

2023-04-28 Thread Vitaliy Makkoveev
> On 28 Apr 2023, at 15:57, Vitaliy Makkoveev wrote: > > On Fri, Apr 28, 2023 at 02:13:15PM +0200, Alexander Bluhm wrote: >> After running stress test successfully with this diff, next day >> machine crashed while compiling a new kernel. It is unclear whether >> it is related to the diff. Th

bgpd: shut up false gcc warnings

2023-04-28 Thread Claudio Jeker
Add default: cases in some switches to detect if shit goes very badly wrong. Right now these code paths are unreachable since the callers of these functions never use a value that is not covered in the switch() but gcc is not smart enough for that. -- :wq Claudio Index: parse.y =

Re: Remove kernel lock from rtfree(9)

2023-04-28 Thread Vitaliy Makkoveev
On Fri, Apr 28, 2023 at 02:13:15PM +0200, Alexander Bluhm wrote: > After running stress test successfully with this diff, next day > machine crashed while compiling a new kernel. It is unclear whether > it is related to the diff. The softdep in ps is problably processing > make output via ssh. L

Re: Initialize `rtentry_pool' with IPL_SOFTNET IPL

2023-04-28 Thread Alexander Bluhm
On Fri, Apr 28, 2023 at 02:51:23PM +0300, Vitaliy Makkoveev wrote: > > On 28 Apr 2023, at 14:03, Alexander Bluhm wrote: > > > > That basically means we must never call one of the pool get or put > > functions with kernel lock. This may be the case currently. But > > at this stage while we are p

Re: DIOCGETRULE is slow for large rulesets (complete diff)

2023-04-28 Thread Alexandr Nedvedicky
Hello, On Fri, Apr 28, 2023 at 11:18:18AM +, Klemens Nanni wrote: > On Fri, Apr 28, 2023 at 12:55:37PM +0200, Alexandr Nedvedicky wrote: > > Hello, > > [ sending off-list ] > > > > up-to-date complete diff. > > Builds, boots and works faster: > > $ time jot -w 'pass proto tcp to port

Re: Remove kernel lock from rtfree(9)

2023-04-28 Thread Alexander Bluhm
On Wed, Apr 26, 2023 at 11:17:37PM +0300, Vitaliy Makkoveev wrote: > Route timers and route labels protected by corresponding mutexes. `ifa' > uses references counting for protection. No protection required for `rt' > passed to rt_mpls_clear() because only current thread owns it. > > ok? > > Inde

Re: Initialize `rtentry_pool' with IPL_SOFTNET IPL

2023-04-28 Thread Vitaliy Makkoveev
> On 28 Apr 2023, at 14:03, Alexander Bluhm wrote: > > That basically means we must never call one of the pool get or put > functions with kernel lock. This may be the case currently. But > at this stage while we are pushing locks around the network code, > I would like to keep it as it is. >

Re: Initialize `rtentry_pool' with IPL_SOFTNET IPL

2023-04-28 Thread Alexander Bluhm
That basically means we must never call one of the pool get or put functions with kernel lock. This may be the case currently. But at this stage while we are pushing locks around the network code, I would like to keep it as it is. Allowing net interrupts during route pool get mutex gains nearly

Re: Add Miller-Rabin with random bases to BPSW primality check

2023-04-28 Thread Theo Buehler
> > - *is_prime = 0; > > + *is_prime = 1; > > Nit: you call this a pseudo-prime - which I agree with, but the variable you > have added > is "is_prime" - maybe call it "maybe-prime" or "pseudo-prime" Yes. I agree. I did this for consistency with the existing code. I will keep this as-is and

Re: Add Miller-Rabin with random bases to BPSW primality check

2023-04-28 Thread Bob Beck
On Fri, Apr 28, 2023 at 10:23:15AM +0200, Theo Buehler wrote: > The behavior of BPSW for numbers > 2^64 is not very well understood. > While there is no known composite that passes the test, there are > heuristics that indicate that there are likely many. Therefore it seems > appropriate to harden

Add Miller-Rabin with random bases to BPSW primality check

2023-04-28 Thread Theo Buehler
The behavior of BPSW for numbers > 2^64 is not very well understood. While there is no known composite that passes the test, there are heuristics that indicate that there are likely many. Therefore it seems appropriate to harden the test. Having a settable number of MR rounds before doing a version