summaryrefslogtreecommitdiffstats
path: root/sys/net/if_spppsubr.c
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2003-03-04 23:19:55 +0000
committerjlemon <jlemon@FreeBSD.org>2003-03-04 23:19:55 +0000
commit04e28d5a816573d1300b4591306a8785d3ace29c (patch)
treef304f726e8973253d3e8a87e56119fec0276a61c /sys/net/if_spppsubr.c
parent45fcac94f475f1d18d50dde4f72eb51ee4abddcc (diff)
downloadFreeBSD-src-04e28d5a816573d1300b4591306a8785d3ace29c.zip
FreeBSD-src-04e28d5a816573d1300b4591306a8785d3ace29c.tar.gz
Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control at some future point. Packets may also be directly dispatched to a netisr instead of queued, this may be of interest at some installations, but currently defaults to off. Reviewed by: hsu, silby, jayanth, sam Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'sys/net/if_spppsubr.c')
-rw-r--r--sys/net/if_spppsubr.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 2df21cf..1c1e972 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -514,7 +514,7 @@ void
sppp_input(struct ifnet *ifp, struct mbuf *m)
{
struct ppp_header *h;
- struct ifqueue *inq = 0;
+ int isr = -1;
struct sppp *sp = (struct sppp *)ifp;
u_char *iphdr;
int hlen, vjlen, do_account = 0;
@@ -591,8 +591,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
return;
case PPP_IP:
if (sp->state[IDX_IPCP] == STATE_OPENED) {
- schednetisr (NETISR_IP);
- inq = &ipintrq;
+ isr = NETISR_IP;
}
do_account++;
break;
@@ -622,9 +621,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
if (m == NULL)
goto drop2;
bcopy(iphdr, mtod(m, u_char *), hlen);
-
- schednetisr (NETISR_IP);
- inq = &ipintrq;
+ isr = NETISR_IP;
}
do_account++;
break;
@@ -641,8 +638,7 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
SPP_ARGS(ifp));
goto drop;
}
- schednetisr (NETISR_IP);
- inq = &ipintrq;
+ isr = NETISR_IP;
}
do_account++;
break;
@@ -655,30 +651,24 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
return;
case PPP_IPV6:
- if (sp->state[IDX_IPV6CP] == STATE_OPENED) {
- schednetisr (NETISR_IPV6);
- inq = &ip6intrq;
- }
+ if (sp->state[IDX_IPV6CP] == STATE_OPENED)
+ isr = NETISR_IPV6;
do_account++;
break;
#endif
#ifdef IPX
case PPP_IPX:
/* IPX IPXCP not implemented yet */
- if (sp->pp_phase == PHASE_NETWORK) {
- schednetisr (NETISR_IPX);
- inq = &ipxintrq;
- }
+ if (sp->pp_phase == PHASE_NETWORK)
+ isr = NETISR_IPX;
do_account++;
break;
#endif
#ifdef NS
case PPP_XNS:
/* XNS IDPCP not implemented yet */
- if (sp->pp_phase == PHASE_NETWORK) {
- schednetisr (NETISR_NS);
- inq = &nsintrq;
- }
+ if (sp->pp_phase == PHASE_NETWORK)
+ isr = NETISR_NS;
do_account++;
break;
#endif
@@ -706,29 +696,25 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
return;
#ifdef INET
case ETHERTYPE_IP:
- schednetisr (NETISR_IP);
- inq = &ipintrq;
+ isr = NETISR_IP;
do_account++;
break;
#endif
#ifdef INET6
case ETHERTYPE_IPV6:
- schednetisr (NETISR_IPV6);
- inq = &ip6intrq;
+ isr = NETISR_IPV6;
do_account++;
break;
#endif
#ifdef IPX
case ETHERTYPE_IPX:
- schednetisr (NETISR_IPX);
- inq = &ipxintrq;
+ isr = NETISR_IPX;
do_account++;
break;
#endif
#ifdef NS
case ETHERTYPE_NS:
- schednetisr (NETISR_NS);
- inq = &nsintrq;
+ isr = NETISR_NS;
do_account++;
break;
#endif
@@ -745,11 +731,11 @@ sppp_input(struct ifnet *ifp, struct mbuf *m)
goto drop;
}
- if (! (ifp->if_flags & IFF_UP) || ! inq)
+ if (! (ifp->if_flags & IFF_UP) || isr == -1)
goto drop;
/* Check queue. */
- if (! IF_HANDOFF(inq, m, NULL)) {
+ if (! netisr_queue(isr, m)) {
if (debug)
log(LOG_DEBUG, SPP_FMT "protocol queue overflow\n",
SPP_ARGS(ifp));
OpenPOWER on IntegriCloud