Module Name:    src
Committed By:   snj
Date:           Thu Nov 23 02:13:31 UTC 2017

Modified Files:
        src/sys/net [netbsd-8]: if_bridge.c if_loop.c

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #382):
        sys/net/if_bridge.c: revision 1.139
        sys/net/if_loop.c: revision 1.97
Don't take KERNEL_LOCK in looutput if NET_MPSAFE
We can perhaps get rid of KERNEL_LOCK from looutput, but for now
keep it for safe.
--
Mark callouts of bridge CALLOUT_MPSAFE


To generate a diff of this commit:
cvs rdiff -u -r1.134.6.1 -r1.134.6.2 src/sys/net/if_bridge.c
cvs rdiff -u -r1.94.6.1 -r1.94.6.2 src/sys/net/if_loop.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_bridge.c
diff -u src/sys/net/if_bridge.c:1.134.6.1 src/sys/net/if_bridge.c:1.134.6.2
--- src/sys/net/if_bridge.c:1.134.6.1	Mon Oct  2 13:33:41 2017
+++ src/sys/net/if_bridge.c	Thu Nov 23 02:13:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bridge.c,v 1.134.6.1 2017/10/02 13:33:41 martin Exp $	*/
+/*	$NetBSD: if_bridge.c,v 1.134.6.2 2017/11/23 02:13:31 snj Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.1 2017/10/02 13:33:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.134.6.2 2017/11/23 02:13:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -415,8 +415,8 @@ bridge_clone_create(struct if_clone *ifc
 	if (error)
 		panic("%s: workqueue_create %d\n", __func__, error);
 
-	callout_init(&sc->sc_brcallout, 0);
-	callout_init(&sc->sc_bstpcallout, 0);
+	callout_init(&sc->sc_brcallout, CALLOUT_MPSAFE);
+	callout_init(&sc->sc_bstpcallout, CALLOUT_MPSAFE);
 
 	mutex_init(&sc->sc_iflist_psref.bip_lock, MUTEX_DEFAULT, IPL_NONE);
 	PSLIST_INIT(&sc->sc_iflist_psref.bip_iflist);

Index: src/sys/net/if_loop.c
diff -u src/sys/net/if_loop.c:1.94.6.1 src/sys/net/if_loop.c:1.94.6.2
--- src/sys/net/if_loop.c:1.94.6.1	Tue Oct 24 08:50:44 2017
+++ src/sys/net/if_loop.c	Thu Nov 23 02:13:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_loop.c,v 1.94.6.1 2017/10/24 08:50:44 snj Exp $	*/
+/*	$NetBSD: if_loop.c,v 1.94.6.2 2017/11/23 02:13:31 snj Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.94.6.1 2017/10/24 08:50:44 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.94.6.2 2017/11/23 02:13:31 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -242,7 +242,9 @@ looutput(struct ifnet *ifp, struct mbuf 
 
 	MCLAIM(m, ifp->if_mowner);
 
+#ifndef NET_MPSAFE
 	KERNEL_LOCK(1, NULL);
+#endif
 
 	if ((m->m_flags & M_PKTHDR) == 0)
 		panic("looutput: no header mbuf");
@@ -368,7 +370,9 @@ looutput(struct ifnet *ifp, struct mbuf 
 	schednetisr(isr);
 	splx(s);
 out:
+#ifndef NET_MPSAFE
 	KERNEL_UNLOCK_ONE(NULL);
+#endif
 	return error;
 }
 

Reply via email to