diff options
author | jlemon <jlemon@FreeBSD.org> | 2003-03-04 23:19:55 +0000 |
---|---|---|
committer | jlemon <jlemon@FreeBSD.org> | 2003-03-04 23:19:55 +0000 |
commit | 04e28d5a816573d1300b4591306a8785d3ace29c (patch) | |
tree | f304f726e8973253d3e8a87e56119fec0276a61c /sys/netatm | |
parent | 45fcac94f475f1d18d50dde4f72eb51ee4abddcc (diff) | |
download | FreeBSD-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/netatm')
-rw-r--r-- | sys/netatm/atm_device.c | 1 | ||||
-rw-r--r-- | sys/netatm/atm_subr.c | 71 | ||||
-rw-r--r-- | sys/netatm/atm_var.h | 2 | ||||
-rw-r--r-- | sys/netatm/ipatm/ipatm_input.c | 5 |
4 files changed, 30 insertions, 49 deletions
diff --git a/sys/netatm/atm_device.c b/sys/netatm/atm_device.c index c85303e..cc2a2a8 100644 --- a/sys/netatm/atm_device.c +++ b/sys/netatm/atm_device.c @@ -99,6 +99,7 @@ static struct t_atm_cause atm_dev_cause = { {0, 0, 0, 0} }; +extern struct ifqueue atm_intrq; /* * ATM Device Stack Instantiation diff --git a/sys/netatm/atm_subr.c b/sys/netatm/atm_subr.c index c76b245..cd78aaf 100644 --- a/sys/netatm/atm_subr.c +++ b/sys/netatm/atm_subr.c @@ -45,7 +45,6 @@ #include <sys/socketvar.h> #include <net/if.h> #include <net/netisr.h> -#include <net/intrq.h> #include <netatm/port.h> #include <netatm/queue.h> #include <netatm/atm.h> @@ -77,6 +76,7 @@ int atm_dev_print = 0; int atm_print_data = 0; int atm_version = ATM_VERSION; struct timeval atm_debugtime = {0, 0}; +struct ifqueue atm_intrq; uma_zone_t atm_attributes_zone; @@ -84,6 +84,7 @@ uma_zone_t atm_attributes_zone; * Local functions */ static KTimeout_ret atm_timexp(void *); +static void atm_intr(struct mbuf *); /* * Local variables @@ -115,10 +116,6 @@ atm_initialize() return; atm_init = 1; - atm_intrq.ifq_maxlen = ATM_INTRQ_MAX; - mtx_init(&atm_intrq.ifq_mtx, "atm_inq", NULL, MTX_DEF); - atmintrq_present = 1; - atm_attributes_zone = uma_zcreate("atm attributes", sizeof(Atm_attributes), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -132,7 +129,9 @@ atm_initialize() panic("atm_initialize: unable to create stackq zone"); uma_zone_set_max(atm_stackq_zone, 10); - register_netisr(NETISR_ATM, atm_intr); + atm_intrq.ifq_maxlen = ATM_INTRQ_MAX; + mtx_init(&atm_intrq.ifq_mtx, "atm_inq", NULL, MTX_DEF); + netisr_register(NETISR_ATM, atm_intr, &atm_intrq); /* * Initialize subsystems @@ -541,52 +540,38 @@ atm_stack_drain() * none * */ -void -atm_intr() +static void +atm_intr(struct mbuf *m) { - KBuffer *m; caddr_t cp; atm_intr_func_t func; void *token; - int s; - for (; ; ) { - /* - * Get next buffer from queue - */ - s = splimp(); - IF_DEQUEUE(&atm_intrq, m); - (void) splx(s); - if (m == NULL) - break; - - /* - * Get function to call and token value - */ - KB_DATASTART(m, cp, caddr_t); - func = *(atm_intr_func_t *)cp; - cp += sizeof(func); - token = *(void **)cp; - KB_HEADADJ(m, -(sizeof(func) + sizeof(token))); - if (KB_LEN(m) == 0) { - KBuffer *m1; - KB_UNLINKHEAD(m, m1); - m = m1; - } + /* + * Get function to call and token value + */ + KB_DATASTART(m, cp, caddr_t); + func = *(atm_intr_func_t *)cp; + cp += sizeof(func); + token = *(void **)cp; + KB_HEADADJ(m, -(sizeof(func) + sizeof(token))); + if (KB_LEN(m) == 0) { + KBuffer *m1; + KB_UNLINKHEAD(m, m1); + m = m1; + } - /* - * Call processing function - */ - (*func)(token, m); + /* + * Call processing function + */ + (*func)(token, m); - /* - * Drain any deferred calls - */ - STACK_DRAIN(); - } + /* + * Drain any deferred calls + */ + STACK_DRAIN(); } - /* * Print a pdu buffer chain * diff --git a/sys/netatm/atm_var.h b/sys/netatm/atm_var.h index 839372c..022f2e3 100644 --- a/sys/netatm/atm_var.h +++ b/sys/netatm/atm_var.h @@ -59,7 +59,6 @@ extern struct atm_ncm *atm_netconv_head; extern Atm_endpoint *atm_endpoints[]; extern struct stackq_entry *atm_stackq_head; extern struct stackq_entry *atm_stackq_tail; -extern struct ifqueue atm_intrq; extern struct atm_sock_stat atm_sock_stat; extern int atm_init; extern int atm_version; @@ -173,7 +172,6 @@ int atm_untimeout(struct atm_time *); int atm_stack_enq(int, void (*)(int, void *, intptr_t, intptr_t), void *, Atm_connvc *, intptr_t, intptr_t); void atm_stack_drain(void); -void atm_intr(void); void atm_pdu_print(KBuffer *, char *); #endif /* _KERNEL */ #endif /* _NETATM_ATM_VAR_H */ diff --git a/sys/netatm/ipatm/ipatm_input.c b/sys/netatm/ipatm/ipatm_input.c index f26a9fb..5be25e0 100644 --- a/sys/netatm/ipatm/ipatm_input.c +++ b/sys/netatm/ipatm/ipatm_input.c @@ -162,9 +162,6 @@ ipatm_ipinput(inp, m) * just call IP directly to avoid the extra unnecessary * kernel scheduling. */ - if (! IF_HANDOFF(&ipintrq, m, NULL)) - return (1); - schednetisr ( NETISR_IP ); + netisr_dispatch(NETISR_IP, m); return (0); } - |