Module Name:    src
Committed By:   msaitoh
Date:           Thu May 15 09:23:03 UTC 2014

Modified Files:
        src/sys/net: if_ppp.c if_spppsubr.c if_tokensubr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/net/if_ppp.c
cvs rdiff -u -r1.127 -r1.128 src/sys/net/if_spppsubr.c
cvs rdiff -u -r1.62 -r1.63 src/sys/net/if_tokensubr.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_ppp.c
diff -u src/sys/net/if_ppp.c:1.141 src/sys/net/if_ppp.c:1.142
--- src/sys/net/if_ppp.c:1.141	Wed Sep 18 23:34:55 2013
+++ src/sys/net/if_ppp.c	Thu May 15 09:23:03 2014
@@ -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 @@ ppp_inproc(struct ppp_softc *sc, struct 
     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 @@ ppp_inproc(struct ppp_softc *sc, struct 
 	if (ipflow_fastforward(m))
 		return;
 #endif
-	schednetisr(NETISR_IP);
+	isr = NETISR_IP;
 	inq = &ipintrq;
 	break;
 #endif
@@ -1648,7 +1649,7 @@ ppp_inproc(struct ppp_softc *sc, struct 
 	if (ip6flow_fastforward(&m))
 		return;
 #endif
-	schednetisr(NETISR_IPV6);
+	isr = NETISR_IPV6;
 	inq = &ip6intrq;
 	break;
 #endif
@@ -1675,6 +1676,7 @@ ppp_inproc(struct ppp_softc *sc, struct 
 	goto bad;
     }
     IF_ENQUEUE(inq, m);
+    schednetisr(isr);
     splx(s);
     ifp->if_ipackets++;
     ifp->if_ibytes += ilen;

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.127 src/sys/net/if_spppsubr.c:1.128
--- src/sys/net/if_spppsubr.c:1.127	Sat Jun 29 21:06:58 2013
+++ src/sys/net/if_spppsubr.c	Thu May 15 09:23:03 2014
@@ -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 @@ sppp_input(struct ifnet *ifp, struct mbu
 	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 @@ sppp_input(struct ifnet *ifp, struct mbu
 				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 @@ sppp_input(struct ifnet *ifp, struct mbu
 		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 @@ sppp_input(struct ifnet *ifp, struct mbu
 
 	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 @@ sppp_input(struct ifnet *ifp, struct mbu
 	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 @@ queue_pkt:
 		goto drop;
 	}
 	IF_ENQUEUE(inq, m);
+	schednetisr(isr);
 	splx(s);
 }
 

Index: src/sys/net/if_tokensubr.c
diff -u src/sys/net/if_tokensubr.c:1.62 src/sys/net/if_tokensubr.c:1.63
--- src/sys/net/if_tokensubr.c:1.62	Fri Mar  1 18:25:57 2013
+++ src/sys/net/if_tokensubr.c	Thu May 15 09:23:03 2014
@@ -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 @@ token_input(struct ifnet *ifp, struct mb
 	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 @@ token_input(struct ifnet *ifp, struct mb
 		switch (etype) {
 #ifdef INET
 		case ETHERTYPE_IP:
-			schednetisr(NETISR_IP);
+			isr = NETISR_IP;
 			inq = &ipintrq;
 			break;
 
 		case ETHERTYPE_ARP:
-			schednetisr(NETISR_ARP);
+			isr = NETISR_ARP;
 			inq = &arpintrq;
 			break;
 #endif
 #ifdef DECNET
 		case ETHERTYPE_DECNET:
-			schednetisr(NETISR_DECNET);
+			isr = NETISR_DECNET;
 			inq = &decnetintrq;
 			break;
 #endif
@@ -512,9 +513,10 @@ token_input(struct ifnet *ifp, struct mb
 	if (IF_QFULL(inq)) {
 		IF_DROP(inq);
 		m_freem(m);
-	}
-	else
+	} else {
 		IF_ENQUEUE(inq, m);
+		schednetisr(isr);
+	}
 	splx(s);
 }
 

Reply via email to