Page MenuHomeFreeBSD

ip6mrouter: Make the expiration callout MPSAFE
ClosedPublic

Authored by markj on Sep 4 2021, 4:17 PM.
Tags
None
Referenced Files
F135375882: D31836.id.diff
Sun, Nov 9, 6:23 AM
F135349541: D31836.id94687.diff
Sun, Nov 9, 12:22 AM
Unknown Object (File)
Tue, Nov 4, 1:52 AM
Unknown Object (File)
Thu, Oct 30, 1:00 PM
Unknown Object (File)
Sat, Oct 25, 4:02 AM
Unknown Object (File)
Sat, Oct 18, 3:40 PM
Unknown Object (File)
Sat, Oct 11, 3:57 PM
Unknown Object (File)
Sep 14 2025, 10:21 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.