Source-Changes-HG archive

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

[src/trunk]: src/sys/net Reduce KERNEL_LOCK thereby ifq_lock is used by default.



details:   https://anonhg.NetBSD.org/src/rev/96a8de2abfc4
branches:  trunk
changeset: 346620:96a8de2abfc4
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Jul 22 07:13:56 2016 +0000

description:
Reduce KERNEL_LOCK thereby ifq_lock is used by default.

if_snd is always excluded by ifq_lock now. So, the KERNEL_LOCK in if_transmit()
which serializes packet output processing is not needed now.

diffstat:

 sys/net/if.c |  14 ++------------
 1 files changed, 2 insertions(+), 12 deletions(-)

diffs (36 lines):

diff -r 2ca0e5cbe015 -r 96a8de2abfc4 sys/net/if.c
--- a/sys/net/if.c      Fri Jul 22 07:09:40 2016 +0000
+++ b/sys/net/if.c      Fri Jul 22 07:13:56 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.355 2016/07/22 07:09:40 knakahara Exp $       */
+/*     $NetBSD: if.c,v 1.356 2016/07/22 07:13:56 knakahara Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.355 2016/07/22 07:09:40 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.356 2016/07/22 07:13:56 knakahara Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -2874,17 +2874,7 @@
 
        s = splnet();
 
-       /*
-        * If NET_MPSAFE is not defined , IFQ_LOCK() is nop.
-        * use KERNEL_LOCK instead of ifq_lock.
-        */
-#ifndef NET_MPSAFE
-       KERNEL_LOCK(1, NULL);
-#endif
        IFQ_ENQUEUE(&ifp->if_snd, m, error);
-#ifndef NET_MPSAFE
-       KERNEL_UNLOCK_ONE(NULL);
-#endif
        if (error != 0) {
                /* mbuf is already freed */
                goto out;



Home | Main Index | Thread Index | Old Index