summaryrefslogtreecommitdiffstats
path: root/sys/net/if_ef.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_ef.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_ef.c')
-rw-r--r--sys/net/if_ef.c95
1 files changed, 46 insertions, 49 deletions
diff --git a/sys/net/if_ef.c b/sys/net/if_ef.c
index e136a6a..86f73c1 100644
--- a/sys/net/if_ef.c
+++ b/sys/net/if_ef.c
@@ -240,70 +240,74 @@ ef_start(struct ifnet *ifp)
* parameter passing but simplify the code
*/
static int __inline
-ef_inputEII(struct mbuf *m, struct ether_header *eh,
- u_short ether_type, struct ifqueue **inq)
+ef_inputEII(struct mbuf *m, struct ether_header *eh, u_short ether_type)
{
+ int isr;
+
switch(ether_type) {
#ifdef IPX
- case ETHERTYPE_IPX:
- schednetisr(NETISR_IPX);
- *inq = &ipxintrq;
+ case ETHERTYPE_IPX:
+ isr = NETISR_IPX;
break;
#endif
#ifdef INET
- case ETHERTYPE_IP:
+ case ETHERTYPE_IP:
if (ipflow_fastforward(m))
- return 1;
- schednetisr(NETISR_IP);
- *inq = &ipintrq;
+ return (0);
+ isr = NETISR_IP;
break;
- case ETHERTYPE_ARP:
- schednetisr(NETISR_ARP);
- *inq = &arpintrq;
+ case ETHERTYPE_ARP:
+ isr = NETISR_ARP;
break;
#endif
- default:
- return EPROTONOSUPPORT;
+ default:
+ return (EPROTONOSUPPORT);
}
- return 0;
+ netisr_dispatch(isr, m);
+ return (0);
}
static int __inline
ef_inputSNAP(struct mbuf *m, struct ether_header *eh, struct llc* l,
- u_short ether_type, struct ifqueue **inq)
+ u_short ether_type)
{
+ int isr;
+
switch(ether_type) {
#ifdef IPX
- case ETHERTYPE_IPX:
+ case ETHERTYPE_IPX:
m_adj(m, 8);
- schednetisr(NETISR_IPX);
- *inq = &ipxintrq;
+ isr = NETISR_IPX;
break;
#endif
- default:
- return EPROTONOSUPPORT;
+ default:
+ return (EPROTONOSUPPORT);
}
- return 0;
+ netisr_dispatch(isr, m);
+ return (0);
}
static int __inline
ef_input8022(struct mbuf *m, struct ether_header *eh, struct llc* l,
- u_short ether_type, struct ifqueue **inq)
+ u_short ether_type)
{
+ int isr;
+
switch(ether_type) {
#ifdef IPX
- case 0xe0:
+ case 0xe0:
m_adj(m, 3);
- schednetisr(NETISR_IPX);
- *inq = &ipxintrq;
+ isr = NETISR_IPX;
break;
#endif
- default:
- return EPROTONOSUPPORT;
+ default:
+ return (EPROTONOSUPPORT);
}
- return 0;
+ netisr_dispatch(isr, m);
+ return (0);
}
+
/*
* Called from ether_input()
*/
@@ -312,11 +316,11 @@ ef_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
{
u_short ether_type;
int ft = -1;
- struct ifqueue *inq;
struct efnet *efp;
struct ifnet *eifp;
struct llc *l;
struct ef_link *efl;
+ int isr;
ether_type = ntohs(eh->ether_type);
if (ether_type < ETHERMTU) {
@@ -377,35 +381,28 @@ ef_input(struct ifnet *ifp, struct ether_header *eh, struct mbuf *m)
/*
* Now we ready to adjust mbufs and pass them to protocol intr's
*/
- inq = NULL;
switch(ft) {
- case ETHER_FT_EII:
- if (ef_inputEII(m, eh, ether_type, &inq) != 0)
- return EPROTONOSUPPORT;
+ case ETHER_FT_EII:
+ return (ef_inputEII(m, eh, ether_type));
break;
#ifdef IPX
- case ETHER_FT_8023: /* only IPX can be here */
- schednetisr(NETISR_IPX);
- inq = &ipxintrq;
+ case ETHER_FT_8023: /* only IPX can be here */
+ isr = NETISR_IPX;
break;
#endif
- case ETHER_FT_SNAP:
- if (ef_inputSNAP(m, eh, l, ether_type, &inq) != 0)
- return EPROTONOSUPPORT;
+ case ETHER_FT_SNAP:
+ return (ef_inputSNAP(m, eh, l, ether_type));
break;
- case ETHER_FT_8022:
- if (ef_input8022(m, eh, l, ether_type, &inq) != 0)
- return EPROTONOSUPPORT;
+ case ETHER_FT_8022:
+ return (ef_input8022(m, eh, l, ether_type));
break;
- }
-
- if (inq == NULL) {
+ default:
EFDEBUG("No support for frame %d and proto %04x\n",
ft, ether_type);
- return EPROTONOSUPPORT;
+ return (EPROTONOSUPPORT);
}
- (void) IF_HANDOFF(inq, m, NULL);
- return 0;
+ netisr_dispatch(isr, m);
+ return (0);
}
static int
OpenPOWER on IntegriCloud