On 03/07/17(Mon) 12:23, Martin Pieuchot wrote:
> All network processing contexts, with the exception of hardware
> interrupt handlers, are now process contexts.  That means the SPL
> protection is no longer needed inside the NET_LOCK().
> 
> So the diff below removes the splsofnet()/splx() dance from the
> NET_LOCK().  I'm not changing the NET_LOCK() macro in the same
> diff in case we find some unexpected bugs and need to revert this
> change.

Here's a simpler diff.  I'd like to move forward with this since it's
the first but blocking step to split the NET_LOCK() and socket locks.

Index: sys/systm.h
===================================================================
RCS file: /cvs/src/sys/sys/systm.h,v
retrieving revision 1.131
diff -u -p -r1.131 systm.h
--- sys/systm.h 29 May 2017 12:12:35 -0000      1.131
+++ sys/systm.h 24 Jul 2017 13:22:37 -0000
@@ -299,12 +299,12 @@ extern struct rwlock netlock;
 #define        NET_LOCK(s)                                                     
\
 do {                                                                   \
        rw_enter_write(&netlock);                                       \
-       s = splsoftnet();                                               \
+       s = IPL_SOFTNET;                                                \
 } while (0)
 
 #define        NET_UNLOCK(s)                                                   
\
 do {                                                                   \
-       splx(s);                                                        \
+       (void)s;                                                        \
        rw_exit_write(&netlock);                                        \
 } while (0)
 
@@ -312,7 +312,6 @@ do {                                                        
                \
 do {                                                                   \
        if (rw_status(&netlock) != RW_WRITE)                            \
                splassert_fail(RW_WRITE, rw_status(&netlock), __func__);\
-       splsoftassert(IPL_SOFTNET);                                     \
 } while (0)
 
 #define        NET_ASSERT_UNLOCKED()                                           
\

Reply via email to