Skip to content

Commit

Permalink
write down some observations about the locking wild west around if_mc…
Browse files Browse the repository at this point in the history
…ast_op()
  • Loading branch information
jdolecek-zz committed May 5, 2020
1 parent c3f273d commit d0ce07f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion doc/TODO.smpnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$NetBSD: TODO.smpnet,v 1.34 2020/01/20 18:40:06 thorpej Exp $
$NetBSD: TODO.smpnet,v 1.35 2020/05/05 09:33:39 jdolecek Exp $

MP-safe components
==================
Expand Down Expand Up @@ -121,6 +121,17 @@ provide a deferred bpf_mtap mechanism that forcibly runs bpf_mtap in softint
context. It's a workaround and once the functions run in softint, we should use
the original bpf_mtap again.

if_mcast_op() - SIOCADDMULTI/SIOCDELMULTI
-----------------------------------------
Helper function is called to add or remove multicast addresses for
interface. When called via ioctl it takes IFNET_LOCK(), when called
via sosetopt() it doesn't.

Various network drivers can't assert IFNET_LOCKED() in their if_ioctl
because of this. Generally drivers still take care to splnet() even
with NET_MPSAFE before calling ether_ioctl(), but they do not take
KERNEL_LOCK(), so this is actually unsafe.

Lingering obsolete variables
-----------------------------

Expand Down

0 comments on commit d0ce07f

Please sign in to comment.