Source-Changes-HG archive

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

[src/trunk]: src/sys/netisdn Use percpuq if_input



details:   https://anonhg.NetBSD.org/src/rev/d0630a253f9d
branches:  trunk
changeset: 819473:d0630a253f9d
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Wed Dec 07 03:23:09 2016 +0000

description:
Use percpuq if_input

It prevents sppp_input from running in hardware interrupt context.

diffstat:

 sys/netisdn/i4b_isppp.c |  20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diffs (58 lines):

diff -r e8f2900d9f48 -r d0630a253f9d sys/netisdn/i4b_isppp.c
--- a/sys/netisdn/i4b_isppp.c   Wed Dec 07 03:22:14 2016 +0000
+++ b/sys/netisdn/i4b_isppp.c   Wed Dec 07 03:23:09 2016 +0000
@@ -34,7 +34,7 @@
  *     the "cx" driver for Cronyx's HDLC-in-hardware device).  This driver
  *     is only the glue between sppp and i4b.
  *
- *     $Id: i4b_isppp.c,v 1.28 2016/06/10 13:27:16 ozaki-r Exp $
+ *     $Id: i4b_isppp.c,v 1.29 2016/12/07 03:23:09 ozaki-r Exp $
  *
  * $FreeBSD$
  *
@@ -43,7 +43,7 @@
  *---------------------------------------------------------------------------*/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i4b_isppp.c,v 1.28 2016/06/10 13:27:16 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i4b_isppp.c,v 1.29 2016/12/07 03:23:09 ozaki-r Exp $");
 
 #ifndef __NetBSD__
 #define USE_ISPPP
@@ -335,6 +335,11 @@
                ether_ifattach(&sc->sc_sp.pp_if, 0);
 #else
                if_attach(&sc->sc_sp.pp_if);
+#ifndef USE_ISPPP
+               sc->sc_sp.pp_if._if_input = sppp_input;
+#else
+               sc->sc_sp.pp_if._if_input = isppp_input;
+#endif
 #endif
 #ifndef USE_ISPPP
                sppp_attach(&sc->sc_sp.pp_if);
@@ -666,7 +671,6 @@
 {
        struct i4bisppp_softc *sc = softc;
        struct mbuf *m;
-       int s;
 
        if((m = *sc->sc_ilt->rx_mbuf) == NULL)
                return;
@@ -697,15 +701,7 @@
 
 #endif /* NBPFILTER > 0  || NBPF > 0 */
 
-       s = splnet();
-
-#ifndef USE_ISPPP
-       sppp_input(&sc->sc_sp.pp_if, m);
-#else
-       isppp_input(&sc->sc_sp.pp_if, m);
-#endif
-
-       splx(s);
+       if_percpuq_enqueue(sc->sc_sp.pp_if.if_percpuq, m);
 }
 
 /*---------------------------------------------------------------------------*



Home | Main Index | Thread Index | Old Index