Download raw body.
wg(4): use `nowake' as tsleep_nsec(9) ident
On Wed, Jan 17, 2024 at 08:55:27PM +0100, Alexander Bluhm wrote: > On Wed, Jan 17, 2024 at 10:21:43AM +0300, Vitaliy Makkoveev wrote: > > It has no corresponding wake(9). > > OK bluhm@ > > Should we replace NET_UNLOCK(); tsleep_nsec(); NET_LOCK(); > with rwsleep_nsec(&netlock)? > I don't think this this is better. We don't use `netlock' directly except the sosleep_nsec() which seems to be the special case. I slightly started to use wg(4) too, so may be I'll remove this hack completely. > > Index: sys/net/if_wg.c > > =================================================================== > > RCS file: /cvs/src/sys/net/if_wg.c,v > > retrieving revision 1.35 > > diff -u -p -r1.35 if_wg.c > > --- sys/net/if_wg.c 1 Jan 2024 18:47:02 -0000 1.35 > > +++ sys/net/if_wg.c 17 Jan 2024 07:19:22 -0000 > > @@ -518,7 +518,7 @@ wg_peer_destroy(struct wg_peer *peer) > > continue; > > } > > NET_UNLOCK(); > > - tsleep_nsec(sc, PWAIT, "wg_ifq", 1000); > > + tsleep_nsec(&nowake, PWAIT, "wg_ifq", 1000); > > NET_LOCK(); > > } > > NET_UNLOCK(); >
wg(4): use `nowake' as tsleep_nsec(9) ident