summaryrefslogtreecommitdiff
path: root/sys/net/if.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-03-17 17:19:18 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-03-17 17:19:18 +0000
commitda29ef7d653b7e20822ba08ddc7013b139d46125 (patch)
treea361e4b2dccdfd5f25e777e214373034ead679fc /sys/net/if.c
parent97968578fca98adc82352fa265539848765983c7 (diff)
Revert the NET_LOCK() and bring back pf's contention lock for release.
For the moment the NET_LOCK() is always taken by threads running under KERNEL_LOCK(). That means it doesn't buy us anything except a possible deadlock that we did not spot. So make sure this doesn't happen, we'll have plenty of time in the next release cycle to stress test it. ok visa@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r--sys/net/if.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index c690c9281a9..c34b5b067f8 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.490 2017/03/08 09:19:45 mpi Exp $ */
+/* $OpenBSD: if.c,v 1.491 2017/03/17 17:19:16 mpi Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -230,12 +230,6 @@ struct taskq *softnettq;
struct task if_input_task_locked = TASK_INITIALIZER(if_netisr, NULL);
/*
- * Serialize socket operations to ensure no new sleeping points
- * are introduced in IP output paths.
- */
-struct rwlock netlock = RWLOCK_INITIALIZER("netlock");
-
-/*
* Network interface utility routines.
*/
void
@@ -1152,10 +1146,7 @@ if_clone_create(const char *name, int rdomain)
if (ifunit(name) != NULL)
return (EEXIST);
- /* XXXSMP breaks atomicity */
- rw_exit_write(&netlock);
ret = (*ifc->ifc_create)(ifc, unit);
- rw_enter_write(&netlock);
if (ret != 0 || (ifp = ifunit(name)) == NULL)
return (ret);
@@ -1197,10 +1188,7 @@ if_clone_destroy(const char *name)
splx(s);
}
- /* XXXSMP breaks atomicity */
- rw_exit_write(&netlock);
ret = (*ifc->ifc_destroy)(ifp);
- rw_enter_write(&netlock);
return (ret);
}