tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Making bpf MPSAFE (was Re: struct ifnet and ifaddr handling ...)



Looking at the use of pserialze functions, you've got a single
data structure (bpf_iflist) that is at some times covered by
bpf_iflist_mtx and others not. That's a bad design. Ideally the
data structure should only be covered by one locking mechanism
so you need to choose whether it is pserialize or mutex. Most
of the work seems easy enough to do with mutex - except for the
copyout section: that will take more thought. If you can't make
it work with just one locking mechanism then ensure that you
always use the same constructs for all of the code paths that
work with bpf_iflist (none are time critical.)

Cheers,
Darren



Home | Main Index | Thread Index | Old Index