Re: bwfm: fix ifconfig media display on rpi2 usb wifi dongle

2022-06-26 Thread Jonathan Gray
On Sun, Jun 26, 2022 at 12:23:14PM +0200, Stefan Sperling wrote: > On Sun, Jun 26, 2022 at 07:48:46PM +1000, Jonathan Gray wrote: > > sta.rssi is later used which is 'Fields valid for ver >= 4' > > but it seems with the earlier zeroing the use here should be fine? > > Thanks! I missed that. > >

pppx(4): don't output packets when no PIPEX_SFLAGS_IP{,6}_FORWARD flags are set

2022-06-26 Thread Vitaliy Makkoveev
npppd(8) clears these flags before it releases IP address assigned to pipex(4) session. This IP could be used for other session, so we should not process packets when these flags are not set. We do PIPEX_SFLAGS_IP{,6}_FORWARD flags check within pipex_ip_output() called by pppac_qstart(), but the

Check `flags' on target session, not multicast session

2022-06-26 Thread Vitaliy Makkoveev
We should check PIPEX_SFLAGS_IP{,6}_FORWARD bits on the session which we will output packet, not on the dummy multicast session. npppd(8) clears these flags before release IP address assigned to session. So this IP address could be assigned to other session while our session is still alive. We

Re: checksum offloading for em

2022-06-26 Thread Jonathan Gray
On Sun, Jun 26, 2022 at 04:43:59PM +0200, Moritz Buhl wrote: > On Sun, Jun 26, 2022 at 12:23:58PM +0200, Moritz Buhl wrote: > > Hi, > > > > I noticed that for some offloading-capable em controllers checksum > > offloading is still disabled and I couldn't find a reason for that. > > > > It was

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Jeremie Courreges-Anglas
On Sun, Jun 26 2022, Alexander Bluhm wrote: > On Sun, Jun 26, 2022 at 11:26:13PM +0200, Jeremie Courreges-Anglas wrote: >> On Mon, Jun 27 2022, Vitaliy Makkoveev wrote: >> > On Sun, Jun 26, 2022 at 10:39:10PM +0200, Alexander Bluhm wrote: >> >> On Sun, Jun 26, 2022 at 07:45:57PM +0300, Vitaliy

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Alexander Bluhm
On Mon, Jun 27, 2022 at 12:42:31AM +0300, Vitaliy Makkoveev wrote: > On Mon, Jun 27, 2022 at 12:39:11AM +0300, Vitaliy Makkoveev wrote: > > On Sun, Jun 26, 2022 at 11:26:13PM +0200, Jeremie Courreges-Anglas wrote: > > > On Mon, Jun 27 2022, Vitaliy Makkoveev wrote: > > > > On Sun, Jun 26, 2022 at

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Vitaliy Makkoveev
On Mon, Jun 27, 2022 at 12:39:11AM +0300, Vitaliy Makkoveev wrote: > On Sun, Jun 26, 2022 at 11:26:13PM +0200, Jeremie Courreges-Anglas wrote: > > On Mon, Jun 27 2022, Vitaliy Makkoveev wrote: > > > On Sun, Jun 26, 2022 at 10:39:10PM +0200, Alexander Bluhm wrote: > > >> On Sun, Jun 26, 2022 at

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Vitaliy Makkoveev
On Sun, Jun 26, 2022 at 11:26:13PM +0200, Jeremie Courreges-Anglas wrote: > On Mon, Jun 27 2022, Vitaliy Makkoveev wrote: > > On Sun, Jun 26, 2022 at 10:39:10PM +0200, Alexander Bluhm wrote: > >> On Sun, Jun 26, 2022 at 07:45:57PM +0300, Vitaliy Makkoveev wrote: > >> > This extra serialization is

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Alexander Bluhm
On Sun, Jun 26, 2022 at 11:26:13PM +0200, Jeremie Courreges-Anglas wrote: > On Mon, Jun 27 2022, Vitaliy Makkoveev wrote: > > On Sun, Jun 26, 2022 at 10:39:10PM +0200, Alexander Bluhm wrote: > >> On Sun, Jun 26, 2022 at 07:45:57PM +0300, Vitaliy Makkoveev wrote: > >> > This extra serialization is

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Jeremie Courreges-Anglas
On Mon, Jun 27 2022, Vitaliy Makkoveev wrote: > On Sun, Jun 26, 2022 at 10:39:10PM +0200, Alexander Bluhm wrote: >> On Sun, Jun 26, 2022 at 07:45:57PM +0300, Vitaliy Makkoveev wrote: >> > This extra serialization is not required. In packet processing path we >> > have shared netlock held, but we

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Vitaliy Makkoveev
On Sun, Jun 26, 2022 at 10:39:10PM +0200, Alexander Bluhm wrote: > On Sun, Jun 26, 2022 at 07:45:57PM +0300, Vitaliy Makkoveev wrote: > > This extra serialization is not required. In packet processing path we > > have shared netlock held, but we do read-only access on per session > > `flags' and

Re: Reset `idle_time' timeout only on opened pipex(4) sessions

2022-06-26 Thread Alexander Bluhm
On Sun, Jun 26, 2022 at 08:12:27PM +0300, Vitaliy Makkoveev wrote: > When pipex(4) session state is PIPEX_STATE_CLOSE_WAIT{,2} this means the > session is already reached time to live timeout, and the garbage > collector waits a little to before kill it. The meaning of `idle_time' > has been

Re: Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Alexander Bluhm
On Sun, Jun 26, 2022 at 07:45:57PM +0300, Vitaliy Makkoveev wrote: > This extra serialization is not required. In packet processing path we > have shared netlock held, but we do read-only access on per session > `flags' and `ifindex'. We always modify them from ioctl(2) path with > exclusive

The notch

2022-06-26 Thread Mark Kettenis
The framebuffer on the 14" and 16" macbook pro is special. The screen is a little bit taller than the standard 16:10 ratio. And the top of the display is partly covered by "the notch" that integrates the camera. The pixels behind the notch exist as far as the framebuffer is considered, but

Reset `idle_time' timeout only on opened pipex(4) sessions

2022-06-26 Thread Vitaliy Makkoveev
When pipex(4) session state is PIPEX_STATE_CLOSE_WAIT{,2} this means the session is already reached time to live timeout, and the garbage collector waits a little to before kill it. The meaning of `idle_time' has been changed. Don't reset `idle_time' timeout for such sessions in packet processing

Don't take kernel lock on pipex(4) pppoe input

2022-06-26 Thread Vitaliy Makkoveev
This extra serialization is not required. In packet processing path we have shared netlock held, but we do read-only access on per session `flags' and `ifindex'. We always modify them from ioctl(2) path with exclusive netlock held. The rest of pipex(4) session is immutable or uses per-session

Re: M-lock __mp_lock implementation

2022-06-26 Thread Jeremie Courreges-Anglas
On Sun, Jun 26 2022, Jeremie Courreges-Anglas wrote: > I noticed that our MI __mp_lock (kernel lock, sched lock) > implementation is based on a ticket lock without any backoff. > The downside of this algorithm is that it results in bus trafic increase > because all the actors are writing (lock

M-lock __mp_lock implementation

2022-06-26 Thread Jeremie Courreges-Anglas
I noticed that our MI __mp_lock (kernel lock, sched lock) implementation is based on a ticket lock without any backoff. The downside of this algorithm is that it results in bus trafic increase because all the actors are writing (lock releaser) and reading (lock waiters) the same memory region

Re: pipex(4): protect global lists with mutex(9)

2022-06-26 Thread Alexander Bluhm
On Sun, Jun 26, 2022 at 05:43:55PM +0300, Vitaliy Makkoveev wrote: > The updated diff below. I'll commit it today later. > - /* [N] peer's address hash chain */ > - uint16_tstate; /* [N] pipex session state */ > +

Re: rtsock change sysctl walker

2022-06-26 Thread Alexander Bluhm
On Sun, Jun 26, 2022 at 10:22:18AM +0200, Claudio Jeker wrote: > Switch the state variables to track the buffer size for the sysctl to > size_t and stop using the somewhat strange way of working with the buf > limit from starting with a negative w_needed. Just use the less confusing > w_needed <=

Re: checksum offloading for em

2022-06-26 Thread Moritz Buhl
On Sun, Jun 26, 2022 at 12:23:58PM +0200, Moritz Buhl wrote: > Hi, > > I noticed that for some offloading-capable em controllers checksum > offloading is still disabled and I couldn't find a reason for that. > > It was assumed during initial implementation: >

Re: pipex(4): protect global lists with mutex(9)

2022-06-26 Thread Vitaliy Makkoveev
On Sun, Jun 26, 2022 at 02:37:41PM +0200, Alexander Bluhm wrote: > On Wed, Jun 22, 2022 at 02:46:32PM +0300, Vitaliy Makkoveev wrote: > > @@ -547,9 +547,11 @@ ether_input(struct ifnet *ifp, struct mb > > > > if ((session = pipex_pppoe_lookup_session(m)) != NULL) { > >

Re: amdgpio(4) : preserve pin configuration on resume

2022-06-26 Thread Mike Larkin
On Wed, Apr 20, 2022 at 11:39:00AM +0200, Mark Kettenis wrote: > > Date: Tue, 19 Apr 2022 22:02:00 -0700 > > From: Mike Larkin > > > > On at least the Asus ROG Zephyrus 14 (2020), the trackpad fails to generate > > any interrupts after resume. I tracked this down to amdgpio(4) not > > generating

Re: pipex(4): protect global lists with mutex(9)

2022-06-26 Thread Alexander Bluhm
On Wed, Jun 22, 2022 at 02:46:32PM +0300, Vitaliy Makkoveev wrote: > @@ -547,9 +547,11 @@ ether_input(struct ifnet *ifp, struct mb > > if ((session = pipex_pppoe_lookup_session(m)) != NULL) { > pipex_pppoe_input(m, session); > +

Re: pipex(4): convert bit fields to flags

2022-06-26 Thread Alexander Bluhm
On Sun, May 22, 2022 at 12:42:04AM +0300, Vitaliy Makkoveev wrote: > 'pipex_mppe' and 'pipex_session' structures have uint16_t bit fields > which represent flags. We mix unlocked access to immutable flags with > protected access to mutable ones. This could be not MP independent on > some

Re: another syzkaller problem in pf

2022-06-26 Thread Alexander Bluhm
On Sun, Jun 26, 2022 at 12:02:41PM +0200, Moritz Buhl wrote: > On Tue, May 03, 2022 at 09:31:51PM +0200, Alexander Bluhm wrote: > ... > > The code is too complex to be sure what the reason of the syzkaller > > panic is. Sleep in malloc is correct anyway and may improve the > > situation. > > > >

checksum offloading for em

2022-06-26 Thread Moritz Buhl
Hi, I noticed that for some offloading-capable em controllers checksum offloading is still disabled and I couldn't find a reason for that. It was assumed during initial implementation: https://marc.info/?l=openbsd-tech=137875739832438=2 According to the datasheets of the i350 controllers listed

Re: bwfm: fix ifconfig media display on rpi2 usb wifi dongle

2022-06-26 Thread Stefan Sperling
On Sun, Jun 26, 2022 at 07:48:46PM +1000, Jonathan Gray wrote: > sta.rssi is later used which is 'Fields valid for ver >= 4' > but it seems with the earlier zeroing the use here should be fine? Thanks! I missed that. Testing suggests it makes more sense to keep the RSSI value which was

Re: another syzkaller problem in pf

2022-06-26 Thread Moritz Buhl
On Tue, May 03, 2022 at 09:31:51PM +0200, Alexander Bluhm wrote: ... > The code is too complex to be sure what the reason of the syzkaller > panic is. Sleep in malloc is correct anyway and may improve the > situation. > > Functions with argument values 0 or 1 are hard to read. It would > be

Re: grep and --null (second try)

2022-06-26 Thread Omar Polo
Omar Polo wrote: > friendly ping :) > > Omar Polo wrote: > > Hello everyone, > > > > one year ago there was a thread for grep --null [0] and there seemed to > > be a general agreement (in the diff, not only in how wrong the name > > --null feels.) In the end it wasn't committed, I got

Re: bwfm: fix ifconfig media display on rpi2 usb wifi dongle

2022-06-26 Thread Jonathan Gray
On Sat, Jun 25, 2022 at 10:07:21PM +0200, Stefan Sperling wrote: > There is an off-by-one in bwfm_update_node(). This function reads > the tx_rate field from station information returned by firmware. > > According to a comment in the Linux driver, this field is valid > for sta_info command

dig(1): no trust

2022-06-26 Thread Florian Obser
A day without a removal diff for dig is a sad day, let's have a happy day! OK? diff --git lib/dns/include/dns/rdataset.h lib/dns/include/dns/rdataset.h index 785821dabf2..26003cfaad4 100644 --- lib/dns/include/dns/rdataset.h +++ lib/dns/include/dns/rdataset.h @@ -86,7 +86,6 @@ struct

Re: grep and --null (second try)

2022-06-26 Thread Omar Polo
friendly ping :) Omar Polo wrote: > Hello everyone, > > one year ago there was a thread for grep --null [0] and there seemed to > be a general agreement (in the diff, not only in how wrong the name > --null feels.) In the end it wasn't committed, I got distracted and > continued to happily

pdaemon: reserve memory for swapping

2022-06-26 Thread Martin Pieuchot
uvm_swap_io() needs to perform up to 4 allocations to write pages to disk. In OOM situation uvm_swap_allocpages() always fail because the kernel doesn't reserve enough pages. Diff below set `uvmexp.reserve_pagedaemon' to the number of pages needed to write a cluster of pages to disk. With this

rtsock change sysctl walker

2022-06-26 Thread Claudio Jeker
Switch the state variables to track the buffer size for the sysctl to size_t and stop using the somewhat strange way of working with the buf limit from starting with a negative w_needed. Just use the less confusing w_needed <= w_given as limit check. -- :wq Claudio Index: net/rtsock.c

Re: netstart(8): don't lie

2022-06-26 Thread Theo de Raadt
Nice improvement. "clearing out existing configuration" is so hairy, it isn't on our roadmap at all. Stuart Henderson wrote: > any comments? does it need a "does not clear things" caveat? ok? > > Index: netstart.8 > === > RCS