Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Usually schednetisr() is called after enqueueing a p...
details: https://anonhg.NetBSD.org/src/rev/04ad8fca2e86
branches: trunk
changeset: 329206:04ad8fca2e86
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Thu May 15 07:35:38 2014 +0000
description:
Usually schednetisr() is called after enqueueing a packet with IF_ENQUEUE().
In some functions, they do it in reverse order. It's not a bug because
the pair is protected with splnet()/splx(s). It's not good for readability
and someone might mistake when modifing a code. Yes, I'm one of the person :-(
Save a NETISR_* value in a variable and call schednetisr() after enqueue
a packet for readability and future modification.
diffstat:
sys/net/if_ethersubr.c | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diffs (94 lines):
diff -r 6fef2dcf20eb -r 04ad8fca2e86 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c Thu May 15 07:11:30 2014 +0000
+++ b/sys/net/if_ethersubr.c Thu May 15 07:35:38 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ethersubr.c,v 1.197 2014/05/13 19:36:16 bouyer Exp $ */
+/* $NetBSD: if_ethersubr.c,v 1.198 2014/05/15 07:35:38 msaitoh Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.197 2014/05/13 19:36:16 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.198 2014/05/15 07:35:38 msaitoh Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@@ -579,6 +579,7 @@
uint16_t etype;
struct ether_header *eh;
size_t ehlen;
+ int isr = 0;
#if defined (LLC) || defined(NETATALK)
struct llc *l;
#endif
@@ -839,12 +840,12 @@
if (ipflow_fastforward(m))
return;
#endif
- schednetisr(NETISR_IP);
+ isr = NETISR_IP;
inq = &ipintrq;
break;
case ETHERTYPE_ARP:
- schednetisr(NETISR_ARP);
+ isr = NETISR_ARP;
inq = &arpintrq;
break;
@@ -862,19 +863,19 @@
if (ip6flow_fastforward(&m))
return;
#endif
- 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
#ifdef NETATALK
case ETHERTYPE_ATALK:
- schednetisr(NETISR_ATALK);
+ isr = NETISR_ATALK;
inq = &atintrq1;
break;
case ETHERTYPE_AARP:
@@ -884,7 +885,7 @@
#endif /* NETATALK */
#ifdef MPLS
case ETHERTYPE_MPLS:
- schednetisr(NETISR_MPLS);
+ isr = NETISR_MPLS;
inq = &mplsintrq;
break;
#endif
@@ -911,7 +912,7 @@
inq = &atintrq2;
m_adj(m, sizeof(struct ether_header)
+ sizeof(struct llc));
- schednetisr(NETISR_ATALK);
+ isr = NETISR_ATALK;
break;
}
@@ -945,8 +946,10 @@
if (IF_QFULL(inq)) {
IF_DROP(inq);
m_freem(m);
- } else
+ } else {
IF_ENQUEUE(inq, m);
+ schednetisr(isr);
+ }
}
/*
Home |
Main Index |
Thread Index |
Old Index