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

Modified Files:
        src/sys/net: if_arcsubr.c if_atmsubr.c if_ecosubr.c if_fddisubr.c
            if_ieee1394subr.c

Log Message:
 Put schednetisr() into splnet()/splx() pair.
This might avoids delay of processing a packet.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/net/if_arcsubr.c
cvs rdiff -u -r1.50 -r1.51 src/sys/net/if_atmsubr.c
cvs rdiff -u -r1.38 -r1.39 src/sys/net/if_ecosubr.c
cvs rdiff -u -r1.84 -r1.85 src/sys/net/if_fddisubr.c
cvs rdiff -u -r1.45 -r1.46 src/sys/net/if_ieee1394subr.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_arcsubr.c
diff -u src/sys/net/if_arcsubr.c:1.64 src/sys/net/if_arcsubr.c:1.65
--- src/sys/net/if_arcsubr.c:1.64	Mon Sep 24 03:05:53 2012
+++ src/sys/net/if_arcsubr.c	Thu May 15 09:04:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arcsubr.c,v 1.64 2012/09/24 03:05:53 msaitoh Exp $	*/
+/*	$NetBSD: if_arcsubr.c,v 1.65 2014/05/15 09:04:03 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Ignatios Souvatzis
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.64 2012/09/24 03:05:53 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arcsubr.c,v 1.65 2014/05/15 09:04:03 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -527,6 +527,7 @@ arc_input(struct ifnet *ifp, struct mbuf
 	struct arc_header *ah;
 	struct ifqueue *inq;
 	uint8_t atype;
+	int isr = 0;
 	int s;
 
 	if ((ifp->if_flags & IFF_UP) == 0) {
@@ -553,19 +554,19 @@ arc_input(struct ifnet *ifp, struct mbuf
 #ifdef INET
 	case ARCTYPE_IP:
 		m_adj(m, ARC_HDRNEWLEN);
-		schednetisr(NETISR_IP);
+		isr = NETISR_IP;
 		inq = &ipintrq;
 		break;
 
 	case ARCTYPE_IP_OLD:
 		m_adj(m, ARC_HDRLEN);
-		schednetisr(NETISR_IP);
+		isr = NETISR_IP;
 		inq = &ipintrq;
 		break;
 
 	case ARCTYPE_ARP:
 		m_adj(m, ARC_HDRNEWLEN);
-		schednetisr(NETISR_ARP);
+		isr = NETISR_ARP;
 		inq = &arpintrq;
 #ifdef ARCNET_ALLOW_BROKEN_ARP
 		mtod(m, struct arphdr *)->ar_pro = htons(ETHERTYPE_IP);
@@ -574,7 +575,7 @@ arc_input(struct ifnet *ifp, struct mbuf
 
 	case ARCTYPE_ARP_OLD:
 		m_adj(m, ARC_HDRLEN);
-		schednetisr(NETISR_ARP);
+		isr = NETISR_ARP;
 		inq = &arpintrq;
 #ifdef ARCNET_ALLOW_BROKEN_ARP
 		mtod(m, struct arphdr *)->ar_pro = htons(ETHERTYPE_IP);
@@ -584,7 +585,7 @@ arc_input(struct ifnet *ifp, struct mbuf
 #ifdef INET6
 	case ARCTYPE_INET6:
 		m_adj(m, ARC_HDRNEWLEN);
-		schednetisr(NETISR_IPV6);
+		isr = NETISR_IPV6;
 		inq = &ip6intrq;
 		break;
 #endif
@@ -597,8 +598,10 @@ arc_input(struct ifnet *ifp, struct mbuf
 	if (IF_QFULL(inq)) {
 		IF_DROP(inq);
 		m_freem(m);
-	} else
+	} else {
 		IF_ENQUEUE(inq, m);
+		schednetisr(isr);
+	}
 	splx(s);
 }
 

Index: src/sys/net/if_atmsubr.c
diff -u src/sys/net/if_atmsubr.c:1.50 src/sys/net/if_atmsubr.c:1.51
--- src/sys/net/if_atmsubr.c:1.50	Thu Oct 11 20:05:50 2012
+++ src/sys/net/if_atmsubr.c	Thu May 15 09:04:03 2014
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_atmsubr.c,v 1.50 2012/10/11 20:05:50 christos Exp $       */
+/*      $NetBSD: if_atmsubr.c,v 1.51 2014/05/15 09:04:03 msaitoh Exp $       */
 
 /*
  * Copyright (c) 1996 Charles D. Cranor and Washington University.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.50 2012/10/11 20:05:50 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_atmsubr.c,v 1.51 2014/05/15 09:04:03 msaitoh Exp $");
 
 #include "opt_inet.h"
 #include "opt_gateway.h"
@@ -228,6 +228,7 @@ atm_input(struct ifnet *ifp, struct atm_
 {
 	struct ifqueue *inq;
 	uint16_t etype = ETHERTYPE_IP; /* default */
+	int isr = 0;
 	int s;
 
 	if ((ifp->if_flags & IFF_UP) == 0) {
@@ -242,7 +243,7 @@ atm_input(struct ifnet *ifp, struct atm_
 	  s = splnet();			/* in case 2 atm cards @ diff lvls */
 	  npcb->npcb_inq++;			/* count # in queue */
 	  splx(s);
-	  schednetisr(NETISR_NATM);
+	  isr = NETISR_NATM;
 	  inq = &natmintrq;
 	  m->m_pkthdr.rcvif = rxhand; /* XXX: overload */
 #else
@@ -281,7 +282,7 @@ atm_input(struct ifnet *ifp, struct atm_
 		  if (ipflow_fastforward(m))
 			return;
 #endif
-		  schednetisr(NETISR_IP);
+		  isr = NETISR_IP;
 		  inq = &ipintrq;
 		  break;
 #endif /* INET */
@@ -291,9 +292,9 @@ atm_input(struct ifnet *ifp, struct atm_
 		if (ip6flow_fastforward(&m))
 			return;
 #endif
-		  schednetisr(NETISR_IPV6);
-		  inq = &ip6intrq;
-		  break;
+		isr = NETISR_IPV6;
+		inq = &ip6intrq;
+		break;
 #endif
 	  default:
 	      m_freem(m);
@@ -305,8 +306,10 @@ atm_input(struct ifnet *ifp, struct atm_
 	if (IF_QFULL(inq)) {
 		IF_DROP(inq);
 		m_freem(m);
-	} else
+	} else {
 		IF_ENQUEUE(inq, m);
+		schednetisr(isr);
+	}
 	splx(s);
 }
 

Index: src/sys/net/if_ecosubr.c
diff -u src/sys/net/if_ecosubr.c:1.38 src/sys/net/if_ecosubr.c:1.39
--- src/sys/net/if_ecosubr.c:1.38	Sun Aug  4 07:05:15 2013
+++ src/sys/net/if_ecosubr.c	Thu May 15 09:04:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ecosubr.c,v 1.38 2013/08/04 07:05:15 kiyohara Exp $	*/
+/*	$NetBSD: if_ecosubr.c,v 1.39 2014/05/15 09:04:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2001 Ben Harris
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.38 2013/08/04 07:05:15 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ecosubr.c,v 1.39 2014/05/15 09:04:03 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -355,6 +355,7 @@ eco_input(struct ifnet *ifp, struct mbuf
 {
 	struct ifqueue *inq;
 	struct eco_header ehdr, *eh;
+	int isr = 0;
 	int s;
 #ifdef INET
 	int i;
@@ -380,7 +381,7 @@ eco_input(struct ifnet *ifp, struct mbuf
 	case ECO_PORT_IP:
 		switch (eh->eco_control) {
 		case ECO_CTL_IP:
-			schednetisr(NETISR_IP);
+			isr = NETISR_IP;
 			inq = &ipintrq;
 			break;
 		case ECO_CTL_ARP_REQUEST:
@@ -426,7 +427,7 @@ eco_input(struct ifnet *ifp, struct mbuf
 			memcpy(ar_tpa(ah), ecah->ecar_tpa, ah->ar_pln);
 			m_freem(m);
 			m = m1;
-			schednetisr(NETISR_ARP);
+			isr = NETISR_ARP;
 			inq = &arpintrq;
 			break;
 		case ECO_CTL_IPBCAST_REQUEST:
@@ -476,8 +477,10 @@ eco_input(struct ifnet *ifp, struct mbuf
 	if (IF_QFULL(inq)) {
 		IF_DROP(inq);
 		m_freem(m);
-	} else
+	} else {
 		IF_ENQUEUE(inq, m);
+		schednetisr(isr);
+	}
 	splx(s);
 }
 

Index: src/sys/net/if_fddisubr.c
diff -u src/sys/net/if_fddisubr.c:1.84 src/sys/net/if_fddisubr.c:1.85
--- src/sys/net/if_fddisubr.c:1.84	Fri Mar  1 18:25:56 2013
+++ src/sys/net/if_fddisubr.c	Thu May 15 09:04:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fddisubr.c,v 1.84 2013/03/01 18:25:56 joerg Exp $	*/
+/*	$NetBSD: if_fddisubr.c,v 1.85 2014/05/15 09:04:03 msaitoh Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.84 2013/03/01 18:25:56 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fddisubr.c,v 1.85 2014/05/15 09:04:03 msaitoh Exp $");
 
 #include "opt_gateway.h"
 #include "opt_inet.h"
@@ -465,6 +465,7 @@ fddi_input(struct ifnet *ifp, struct mbu
 #endif
 	struct llc *l;
 	struct fddi_header *fh;
+	int isr = 0;
 
 	MCLAIM(m, &((struct ethercom *)ifp)->ec_rx_mowner);
 	if ((ifp->if_flags & IFF_UP) == 0) {
@@ -517,7 +518,7 @@ fddi_input(struct ifnet *ifp, struct mbu
 		 	ntohs(l->llc_snap_ether_type) == ETHERTYPE_ATALK) {
 		    inq = &atintrq2;
 		    m_adj( m, sizeof( struct llc ));
-		    schednetisr(NETISR_ATALK);
+		    isr = NETISR_ATALK;
 		    break;
 		}
 
@@ -547,13 +548,13 @@ fddi_input(struct ifnet *ifp, struct mbu
 			if (ipflow_fastforward(m))
 				return;
 #endif
-			schednetisr(NETISR_IP);
+			isr = NETISR_IP;
 			inq = &ipintrq;
 			break;
 
 		case ETHERTYPE_ARP:
 #if !defined(__bsdi__) || _BSDI_VERSION >= 199401
-			schednetisr(NETISR_ARP);
+			isr = NETISR_ARP;
 			inq = &arpintrq;
 			break;
 #else
@@ -563,7 +564,7 @@ fddi_input(struct ifnet *ifp, struct mbu
 #endif
 #ifdef IPX
 		case ETHERTYPE_IPX:
-			schednetisr(NETISR_IPX);
+			isr = NETISR_IPX;
 			inq = &ipxintrq;
 			break;
 #endif
@@ -573,20 +574,20 @@ fddi_input(struct ifnet *ifp, struct mbu
 			if (ip6flow_fastforward(&m))
 				return;
 #endif
-			schednetisr(NETISR_IPV6);
+			isr = NETISR_IPV6;
 			inq = &ip6intrq;
 			break;
 
 #endif
 #ifdef DECNET
 		case ETHERTYPE_DECNET:
-			schednetisr(NETISR_DECNET);
+			isr = NETISR_DECNET;
 			inq = &decnetintrq;
 			break;
 #endif
 #ifdef NETATALK
 		case ETHERTYPE_ATALK:
-	                schednetisr(NETISR_ATALK);
+	                isr = NETISR_ATALK;
 			inq = &atintrq1;
 			break;
 	        case ETHERTYPE_AARP:
@@ -616,8 +617,10 @@ fddi_input(struct ifnet *ifp, struct mbu
 	if (IF_QFULL(inq)) {
 		IF_DROP(inq);
 		m_freem(m);
-	} else
+	} else {
 		IF_ENQUEUE(inq, m);
+		schednetisr(isr);
+	}
 	splx(s);
 #endif
 }

Index: src/sys/net/if_ieee1394subr.c
diff -u src/sys/net/if_ieee1394subr.c:1.45 src/sys/net/if_ieee1394subr.c:1.46
--- src/sys/net/if_ieee1394subr.c:1.45	Mon Apr  5 07:22:23 2010
+++ src/sys/net/if_ieee1394subr.c	Thu May 15 09:04:03 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ieee1394subr.c,v 1.45 2010/04/05 07:22:23 joerg Exp $	*/
+/*	$NetBSD: if_ieee1394subr.c,v 1.46 2014/05/15 09:04:03 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.45 2010/04/05 07:22:23 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.46 2014/05/15 09:04:03 msaitoh Exp $");
 
 #include "opt_inet.h"
 
@@ -360,6 +360,7 @@ ieee1394_input(struct ifnet *ifp, struct
 	uint16_t etype;
 	int s;
 	struct ieee1394_unfraghdr *iuh;
+	int isr = 0;
 
 	if ((ifp->if_flags & IFF_UP) == 0) {
 		m_freem(m);
@@ -407,19 +408,19 @@ ieee1394_input(struct ifnet *ifp, struct
 	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 /* INET */
 
 #ifdef INET6
 	case ETHERTYPE_IPV6:
-		schednetisr(NETISR_IPV6);
+		isr = NETISR_IPV6;
 		inq = &ip6intrq;
 		break;
 #endif /* INET6 */
@@ -433,8 +434,10 @@ ieee1394_input(struct ifnet *ifp, struct
 	if (IF_QFULL(inq)) {
 		IF_DROP(inq);
 		m_freem(m);
-	} else
+	} else {
 		IF_ENQUEUE(inq, m);
+		schednetisr(isr);
+	}
 	splx(s);
 }
 

Reply via email to