Module Name:    src
Committed By:   ozaki-r
Date:           Wed Nov 15 04:08:02 UTC 2017

Modified Files:
        src/sys/net: if_loop.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 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_loop.c
diff -u src/sys/net/if_loop.c:1.96 src/sys/net/if_loop.c:1.97
--- src/sys/net/if_loop.c:1.96	Mon Oct 23 09:32:00 2017
+++ src/sys/net/if_loop.c	Wed Nov 15 04:08:02 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_loop.c,v 1.96 2017/10/23 09:32:00 msaitoh Exp $	*/
+/*	$NetBSD: if_loop.c,v 1.97 2017/11/15 04:08:02 ozaki-r 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.96 2017/10/23 09:32:00 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_loop.c,v 1.97 2017/11/15 04:08:02 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -247,7 +247,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");
@@ -373,7 +375,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