Page MenuHomeFreeBSD

ip6mrouter: Make the expiration callout MPSAFE
ClosedPublic

Authored by markj on Sep 4 2021, 4:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 26, 10:31 AM
Unknown Object (File)
Wed, Jun 26, 12:41 AM
Unknown Object (File)
Mon, Jun 24, 10:06 PM
Unknown Object (File)
Sun, Jun 23, 12:43 PM
Unknown Object (File)
Sat, Jun 22, 8:23 PM
Unknown Object (File)
Sat, Jun 22, 3:52 PM
Unknown Object (File)
Sat, Jun 22, 2:45 AM
Unknown Object (File)
Sat, Jun 22, 12:27 AM

Details

Summary
- Protect the `expire_upcalls` callout with the MFC6 mutex.  The callout
  handler needs this mutex anyway.
- Convert the MROUTER6 mutex to a sleepable sx lock.  It is only used
  when configuring the global v6 multicast routing socket, so is only
  used in system call paths where sleeping is safe.  This lets us drain
  the callout without having to drop the lock.
- For all locking macros in the file, convert to using a _LOCKPTR macro.
Test Plan

Just build-tested so far, some basic test program is needed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Sep 4 2021, 4:17 PM
markj added a reviewer: network.
markj added a subscriber: mav.
sys/netinet6/ip6_mroute.c
584

What's the point of locking it here?

sys/netinet6/ip6_mroute.c
584

I forgot that the lock is not required by callout_reset().

  • Remove unneeded locking.
  • Remove stray whitespace change.
This revision was not accepted when it landed; it landed in state Needs Review.Sep 7 2021, 3:27 PM
This revision was automatically updated to reflect the committed changes.