Source-Changes-HG archive

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

[src/trunk]: src/sys/net Cleanup ppp_inproc



details:   https://anonhg.NetBSD.org/src/rev/c3bcab4eba8b
branches:  trunk
changeset: 796989:c3bcab4eba8b
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jun 30 12:56:51 2014 +0000

description:
Cleanup ppp_inproc

- Remove unnecessary variable isr
- Use pktq instead of rv to switch between inet/inet6 and other protocols

ok msaitoh@ and rmind@

diffstat:

 sys/net/if_ppp.c |  18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diffs (81 lines):

diff -r 6c1e59def100 -r c3bcab4eba8b sys/net/if_ppp.c
--- a/sys/net/if_ppp.c  Mon Jun 30 10:03:41 2014 +0000
+++ b/sys/net/if_ppp.c  Mon Jun 30 12:56:51 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ppp.c,v 1.144 2014/06/05 23:48:16 rmind Exp $       */
+/*     $NetBSD: if_ppp.c,v 1.145 2014/06/30 12:56:51 ozaki-r 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.144 2014/06/05 23:48:16 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.145 2014/06/30 12:56:51 ozaki-r Exp $");
 
 #include "ppp.h"
 
@@ -1396,7 +1396,6 @@
     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;
@@ -1607,7 +1606,6 @@
     /* See if bpf wants to look at the packet. */
     bpf_mtap(&sc->sc_if, m);
 
-    rv = 0;
     switch (proto) {
 #ifdef INET
     case PPP_IP:
@@ -1658,7 +1656,7 @@
         * Some other protocol - place on input queue for read().
         */
        inq = &sc->sc_inq;
-       rv = 1;
+       pktq = NULL;
        break;
     }
 
@@ -1667,6 +1665,7 @@
      */
     s = splnet();
 
+    /* pktq: inet or inet6 cases */
     if (__predict_true(pktq)) {
        if (__predict_false(!pktq_enqueue(pktq, m, 0))) {
            ifp->if_iqdrops++;
@@ -1675,11 +1674,10 @@
        ifp->if_ipackets++;
        ifp->if_ibytes += ilen;
        splx(s);
-       if (rv)
-           (*sc->sc_ctlp)(sc);
        return;
     }
 
+    /* ifq: other protocol cases */
     if (!inq) {
        goto bad;
     }
@@ -1692,15 +1690,11 @@
        goto bad;
     }
     IF_ENQUEUE(inq, m);
-    if (__predict_true(isr)) {
-        schednetisr(isr);
-    }
     splx(s);
     ifp->if_ipackets++;
     ifp->if_ibytes += ilen;
 
-    if (rv)
-       (*sc->sc_ctlp)(sc);
+    (*sc->sc_ctlp)(sc);
 
     return;
 



Home | Main Index | Thread Index | Old Index