Source-Changes-HG archive

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

[src/trunk]: src/sys Save a NETISR_* value in a variable and call schednetisr...



details:   https://anonhg.NetBSD.org/src/rev/f79c08aa17a8
branches:  trunk
changeset: 329210:f79c08aa17a8
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu May 15 09:23:03 2014 +0000

description:
Save a NETISR_* value in a variable and call schednetisr() after enqueue
a packet for readability and future modification.

diffstat:

 sys/dev/ic/hd64570.c   |  10 ++++++----
 sys/dev/qbus/if_dmc.c  |  11 +++++++----
 sys/dev/usb/if_upl.c   |   6 +++---
 sys/net/if_ppp.c       |  10 ++++++----
 sys/net/if_spppsubr.c  |  18 ++++++++++--------
 sys/net/if_tokensubr.c |  16 +++++++++-------
 6 files changed, 41 insertions(+), 30 deletions(-)

diffs (truncated from 330 to 300 lines):

diff -r 1424210b7372 -r f79c08aa17a8 sys/dev/ic/hd64570.c
--- a/sys/dev/ic/hd64570.c      Thu May 15 09:04:03 2014 +0000
+++ b/sys/dev/ic/hd64570.c      Thu May 15 09:23:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hd64570.c,v 1.45 2013/09/14 13:09:18 joerg Exp $       */
+/*     $NetBSD: hd64570.c,v 1.46 2014/05/15 09:23:52 msaitoh Exp $     */
 
 /*
  * Copyright (c) 1999 Christian E. Hopps
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.45 2013/09/14 13:09:18 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64570.c,v 1.46 2014/05/15 09:23:52 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -1536,6 +1536,7 @@
        u_int8_t *bufp;
        u_int16_t len;
        u_int32_t t;
+       int isr = 0;
 
        t = time_uptime * 1000;
        desc = &scp->sp_rxdesc[scp->sp_rxstart];
@@ -1587,7 +1588,7 @@
                m->m_data += sizeof(struct hdlc_header);
                m->m_len -= sizeof(struct hdlc_header);
                ifq = &ipintrq;
-               schednetisr(NETISR_IP);
+               isr = NETISR_IP;
                break;
 #endif /* INET */
 #ifdef INET6
@@ -1598,7 +1599,7 @@
                m->m_data += sizeof(struct hdlc_header);
                m->m_len -= sizeof(struct hdlc_header);
                ifq = &ip6intrq;
-               schednetisr(NETISR_IPV6);
+               isr = NETISR_IPV6;
                break;
 #endif /* INET6 */
        case CISCO_KEEPALIVE:
@@ -1691,6 +1692,7 @@
        /* queue the packet */
        if (!IF_QFULL(ifq)) {
                IF_ENQUEUE(ifq, m);
+               schednetisr(isr);
        } else {
                IF_DROP(ifq);
                scp->sp_if.if_iqdrops++;
diff -r 1424210b7372 -r f79c08aa17a8 sys/dev/qbus/if_dmc.c
--- a/sys/dev/qbus/if_dmc.c     Thu May 15 09:04:03 2014 +0000
+++ b/sys/dev/qbus/if_dmc.c     Thu May 15 09:23:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_dmc.c,v 1.21 2012/10/27 17:18:37 chs Exp $  */
+/*     $NetBSD: if_dmc.c,v 1.22 2014/05/15 09:23:52 msaitoh Exp $      */
 /*
  * Copyright (c) 1982, 1986 Regents of the University of California.
  * All rights reserved.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.21 2012/10/27 17:18:37 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_dmc.c,v 1.22 2014/05/15 09:23:52 msaitoh Exp $");
 
 #undef DMCDEBUG        /* for base table dump on fatal error */
 
@@ -560,6 +560,7 @@
        struct ifxmt *ifxp;
        struct dmc_header *dh;
        char buf[64];
+       int isr = 0;
 
        ifp = &sc->sc_if;
 
@@ -627,7 +628,7 @@
 
 #ifdef INET
                        case DMC_IPTYPE:
-                               schednetisr(NETISR_IP);
+                               isr = NETISR_IP;
                                inq = &ipintrq;
                                break;
 #endif
@@ -640,8 +641,10 @@
                        if (IF_QFULL(inq)) {
                                IF_DROP(inq);
                                m_freem(m);
-                       } else
+                       } else {
                                IF_ENQUEUE(inq, m);
+                               schednetisr(isr);
+                       }
                        splx(s);
 
        setup:
diff -r 1424210b7372 -r f79c08aa17a8 sys/dev/usb/if_upl.c
--- a/sys/dev/usb/if_upl.c      Thu May 15 09:04:03 2014 +0000
+++ b/sys/dev/usb/if_upl.c      Thu May 15 09:23:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_upl.c,v 1.44 2013/01/05 01:30:16 christos Exp $     */
+/*     $NetBSD: if_upl.c,v 1.45 2014/05/15 09:23:52 msaitoh Exp $      */
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.44 2013/01/05 01:30:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_upl.c,v 1.45 2014/05/15 09:23:52 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1038,7 +1038,6 @@
 
        /* XXX Assume all traffic is IP */
 
-       schednetisr(NETISR_IP);
        inq = &ipintrq;
 
        s = splnet();
@@ -1053,6 +1052,7 @@
                return;
        }
        IF_ENQUEUE(inq, m);
+       schednetisr(NETISR_IP);
        splx(s);
 #endif
        ifp->if_ipackets++;
diff -r 1424210b7372 -r f79c08aa17a8 sys/net/if_ppp.c
--- a/sys/net/if_ppp.c  Thu May 15 09:04:03 2014 +0000
+++ b/sys/net/if_ppp.c  Thu May 15 09:23:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ppp.c,v 1.141 2013/09/18 23:34:55 rmind Exp $       */
+/*     $NetBSD: if_ppp.c,v 1.142 2014/05/15 09:23:03 msaitoh Exp $     */
 /*     Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp       */
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.141 2013/09/18 23:34:55 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.142 2014/05/15 09:23:03 msaitoh Exp $");
 
 #include "ppp.h"
 
@@ -1395,6 +1395,7 @@
     int s, ilen, proto, rv;
     u_char *cp, adrs, ctrl;
     struct mbuf *mp, *dmp = NULL;
+    int isr = 0;
 #ifdef VJC
     int xlen;
     u_char *iphdr;
@@ -1625,7 +1626,7 @@
        if (ipflow_fastforward(m))
                return;
 #endif
-       schednetisr(NETISR_IP);
+       isr = NETISR_IP;
        inq = &ipintrq;
        break;
 #endif
@@ -1648,7 +1649,7 @@
        if (ip6flow_fastforward(&m))
                return;
 #endif
-       schednetisr(NETISR_IPV6);
+       isr = NETISR_IPV6;
        inq = &ip6intrq;
        break;
 #endif
@@ -1675,6 +1676,7 @@
        goto bad;
     }
     IF_ENQUEUE(inq, m);
+    schednetisr(isr);
     splx(s);
     ifp->if_ipackets++;
     ifp->if_ibytes += ilen;
diff -r 1424210b7372 -r f79c08aa17a8 sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Thu May 15 09:04:03 2014 +0000
+++ b/sys/net/if_spppsubr.c     Thu May 15 09:23:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_spppsubr.c,v 1.127 2013/06/29 21:06:58 rmind Exp $   */
+/*     $NetBSD: if_spppsubr.c,v 1.128 2014/05/15 09:23:03 msaitoh Exp $         */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.127 2013/06/29 21:06:58 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.128 2014/05/15 09:23:03 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -471,6 +471,7 @@
        int s;
        struct sppp *sp = (struct sppp *)ifp;
        int debug = ifp->if_flags & IFF_DEBUG;
+       int isr = 0;
 
        if (ifp->if_flags & IFF_UP) {
                /* Count received bytes, add hardware framing */
@@ -538,19 +539,19 @@
                                return;
 #ifdef INET
                        case ETHERTYPE_IP:
-                               schednetisr(NETISR_IP);
+                               isr = NETISR_IP;
                                inq = &ipintrq;
                                break;
 #endif
 #ifdef INET6
                        case ETHERTYPE_IPV6:
-                               schednetisr(NETISR_IPV6);
+                               isr = NETISR_IPV6;
                                inq = &ip6intrq;
                                break;
 #endif
 #ifdef IPX
                        case ETHERTYPE_IPX:
-                               schednetisr(NETISR_IPX);
+                               isr = NETISR_IPX;
                                inq = &ipxintrq;
                                break;
 #endif
@@ -605,7 +606,7 @@
                return;
        case PPP_IP:
                if (sp->state[IDX_IPCP] == STATE_OPENED) {
-                       schednetisr(NETISR_IP);
+                       isr = NETISR_IP;
                        inq = &ipintrq;
                        sp->pp_last_activity = time_uptime;
                }
@@ -620,7 +621,7 @@
 
        case PPP_IPV6:
                if (sp->state[IDX_IPV6CP] == STATE_OPENED) {
-                       schednetisr(NETISR_IPV6);
+                       isr = NETISR_IPV6;
                        inq = &ip6intrq;
                        sp->pp_last_activity = time_uptime;
                }
@@ -630,7 +631,7 @@
        case PPP_IPX:
                /* IPX IPXCP not implemented yet */
                if (sp->pp_phase == SPPP_PHASE_NETWORK) {
-                       schednetisr(NETISR_IPX);
+                       isr = NETISR_IPX;
                        inq = &ipxintrq;
                }
                break;
@@ -653,6 +654,7 @@
                goto drop;
        }
        IF_ENQUEUE(inq, m);
+       schednetisr(isr);
        splx(s);
 }
 
diff -r 1424210b7372 -r f79c08aa17a8 sys/net/if_tokensubr.c
--- a/sys/net/if_tokensubr.c    Thu May 15 09:04:03 2014 +0000
+++ b/sys/net/if_tokensubr.c    Thu May 15 09:23:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tokensubr.c,v 1.62 2013/03/01 18:25:57 joerg Exp $  */
+/*     $NetBSD: if_tokensubr.c,v 1.63 2014/05/15 09:23:03 msaitoh Exp $        */
 
 /*
  * Copyright (c) 1982, 1989, 1993
@@ -92,7 +92,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.62 2013/03/01 18:25:57 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.63 2014/05/15 09:23:03 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_atalk.h"
@@ -421,6 +421,7 @@
        struct llc *l;
        struct token_header *trh;
        int s, lan_hdr_len;
+       int isr = 0;
 
        if ((ifp->if_flags & IFF_UP) == 0) {
                m_freem(m);
@@ -472,18 +473,18 @@
                switch (etype) {
 #ifdef INET
                case ETHERTYPE_IP:
-                       schednetisr(NETISR_IP);



Home | Main Index | Thread Index | Old Index