freebsd-skq/sys/net
wpaul cf16a7efdb Attempt to fix a problem with receiving packets on USB ethernet interfaces.
Packets are received inside USB bulk transfer callbacks, which run at
splusb() (actually splbio()). The packet input queues are meant to be
manipulated at splimp(). However the locking apparently breaks down under
certain circumstances and the input queues can get trampled.

There's a similar problem with if_ppp, which is driven by hardware/tty
interrupts from the serial driver, but which must also manipulate the
packet input queues at splimp(). The fix there is to use a netisr, and
that's the fix I used here. (I can hear you groaning back there. Hush up.)

The usb_ethersubr module maintains a single queue of its own. When a
packet is received in the USB callback routine, it's placed on this
queue with usb_ether_input(). This routine also schedules a soft net
interrupt with schednetisr(). The ISR routine then runs later, at
splnet, outside of the USB callback/interrupt context, and passes the
packet to ether_input(), hopefully in a safe manner.

The reason this is implemented as a separate module is that there are
a limited number of NETISRs that we can use, and snarfing one up for
each driver that needs it is wasteful (there will be three once I get
the CATC driver done). It also reduces code duplication to a certain
small extent. Unfortunately, it also needs to be linked in with the
usb.ko module in order for the USB ethernet drivers to share it.

Also removed some uneeded includes from if_aue.c and if_kue.c

Fix suggested by: peter
Not rejected as a hairbrained idea by: n_hibma
2000-01-10 23:12:54 +00:00
..
bpf_compat.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
bpf_filter.c Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
bpf.c Make the stub routines have the same prototypes as the real bpf 1999-12-03 09:59:02 +00:00
bpf.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
bpfdesc.h Implement pseudo_AF_HDRCMPLT, which controls the state of the 'header 1999-10-15 05:07:00 +00:00
bridge.c IPSEC support in the kernel. 1999-12-22 19:13:38 +00:00
bridge.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
bsd_comp.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ethernet.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
fddi.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
hostcache.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
hostcache.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_arp.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_atm.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_atmsubr.c udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_disc.c udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_dl.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_ef.c Bring up an if_ef driver which allows support for four ethernet 1999-12-13 16:24:22 +00:00
if_ethersubr.c M_PREPEND-related cleanups (unregisterifying struct mbuf *s). 1999-12-19 01:55:37 +00:00
if_faith.c Remove BROADCAST flag from faith interface, 2000-01-09 04:35:39 +00:00
if_fddisubr.c M_PREPEND-related cleanups (unregisterifying struct mbuf *s). 1999-12-19 01:55:37 +00:00
if_gif.c udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_gif.h udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_iso88025subr.c M_PREPEND-related cleanups (unregisterifying struct mbuf *s). 1999-12-19 01:55:37 +00:00
if_llc.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_loop.c udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_media.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_media.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_mib.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_mib.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_ppp.c Minor tidy up of PPP_FILTER and NBPF stuff. Don't generate bpf.h in the 1999-09-26 18:44:29 +00:00
if_ppp.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_pppvar.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_sl.c Re-allocate cblocks after changing the slip unit number. 1999-10-28 16:04:59 +00:00
if_slvar.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_sppp.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_spppsubr.c udp IPv6 support, IPv6/IPv4 tunneling support in kernel, 1999-12-07 17:39:16 +00:00
if_tun.c Zap #include "tun.h" (for NTUN) - which isn't used anymore. 1999-09-27 00:55:29 +00:00
if_tun.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_tunvar.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
if_types.h KAME related header files additions and merges. 1999-11-05 14:41:39 +00:00
if_var.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_vlan_var.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
if_vlan.c The current code incorrectly assumes that all vlans 1999-12-13 01:57:00 +00:00
if.c Prevent kernel panic at ifconfig up after Note PC resume. 1999-12-30 18:29:55 +00:00
if.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
iso88025.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
net_osdep.c KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCP 1999-11-22 02:45:11 +00:00
net_osdep.h KAME netinet6 basic part(no IPsec,no V6 Multicast Forwarding, no UDP/TCP 1999-11-22 02:45:11 +00:00
netisr.h Attempt to fix a problem with receiving packets on USB ethernet interfaces. 2000-01-10 23:12:54 +00:00
pfkeyv2.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
ppp_comp.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ppp_deflate.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ppp_defs.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
ppp_tty.c This patch clears the way for removing a number of tty related 1999-09-25 16:21:39 +00:00
radix.c Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
radix.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
raw_cb.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
raw_cb.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
raw_usrreq.c $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
route.c IPSEC support in the kernel. 1999-12-22 19:13:38 +00:00
route.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
rtsock.c Make cloning mask sockaddr (genmask) possible. 1999-12-28 08:38:01 +00:00
slcompress.c Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
slcompress.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
slip.h $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
zlib.c Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00
zlib.h Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL" 1999-12-29 04:46:21 +00:00